Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] mm: restore vm_normal_page check

Hugh is rightly concerned that the CONFIG_DEBUG_VM coverage has gone too
far in vm_normal_page, considering that we expect production kernels to be
shipped with the option turned off, and that the code has been under some
large changes recently.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Nick Piggin and committed by
Linus Torvalds
315ab19a f081a529

+6 -2
+6 -2
mm/memory.c
··· 395 395 return NULL; 396 396 } 397 397 398 - #ifdef CONFIG_DEBUG_VM 398 + /* 399 + * Add some anal sanity checks for now. Eventually, 400 + * we should just do "return pfn_to_page(pfn)", but 401 + * in the meantime we check that we get a valid pfn, 402 + * and that the resulting page looks ok. 403 + */ 399 404 if (unlikely(!pfn_valid(pfn))) { 400 405 print_bad_pte(vma, pte, addr); 401 406 return NULL; 402 407 } 403 - #endif 404 408 405 409 /* 406 410 * NOTE! We still have PageReserved() pages in the page