diff options
author | Carsten Otte <cotte@de.ibm.com> | 2008-01-17 18:21:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-17 18:38:59 -0500 |
commit | 9723198c219f3546982cb469e5aed26e68399055 (patch) | |
tree | b8e195cb1ca1bdf143e4e564fdb43f09aadfd6f3 | |
parent | 6b2d2cec1081a979e0efd6a1e9559e5a01a3c10e (diff) |
#ifdef very expensive debug check in page fault path
This patch puts #ifdef CONFIG_DEBUG_VM around a check in vm_normal_page
that verifies that a pfn is valid. This patch increases performance of the
page fault microbenchmark in lmbench by 13% and overall dbench performance
by 7% on s390x. pfn_valid() is an expensive operation on s390 that needs a
high double digit amount of CPU cycles. Nick Piggin suggested that
pfn_valid() involves an array lookup on systems with sparsemem, and
therefore is an expensive operation there too.
The check looks like a clear debug thing to me, it should never trigger on
regular kernels. And if a pte is created for an invalid pfn, we'll find
out once the memory gets accessed later on anyway. Please consider
inclusion of this patch into mm.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/memory.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 4bf0b6d0eb2a..6dd1cd88bfb6 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -392,6 +392,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ | |||
392 | return NULL; | 392 | return NULL; |
393 | } | 393 | } |
394 | 394 | ||
395 | #ifdef CONFIG_DEBUG_VM | ||
395 | /* | 396 | /* |
396 | * Add some anal sanity checks for now. Eventually, | 397 | * Add some anal sanity checks for now. Eventually, |
397 | * we should just do "return pfn_to_page(pfn)", but | 398 | * we should just do "return pfn_to_page(pfn)", but |
@@ -402,6 +403,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ | |||
402 | print_bad_pte(vma, pte, addr); | 403 | print_bad_pte(vma, pte, addr); |
403 | return NULL; | 404 | return NULL; |
404 | } | 405 | } |
406 | #endif | ||
405 | 407 | ||
406 | /* | 408 | /* |
407 | * NOTE! We still have PageReserved() pages in the page | 409 | * NOTE! We still have PageReserved() pages in the page |