diff options
author | Nick Piggin <npiggin@suse.de> | 2006-03-22 00:08:42 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 07:54:02 -0800 |
commit | b7ab795b7bec9997d4fde39f249d52823d36d98d (patch) | |
tree | 8b8825a0718ec38b5b0840fe06efa9a92a0e30c7 /mm/rmap.c | |
parent | 6626c5d53bc45c59798628677ba5606f02e371f3 (diff) | |
download | linux-3.10-b7ab795b7bec9997d4fde39f249d52823d36d98d.tar.gz linux-3.10-b7ab795b7bec9997d4fde39f249d52823d36d98d.tar.bz2 linux-3.10-b7ab795b7bec9997d4fde39f249d52823d36d98d.zip |
[PATCH] mm: more CONFIG_DEBUG_VM
Put a few more checks under CONFIG_DEBUG_VM
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/rmap.c b/mm/rmap.c index 134aef9d66c..1963e269314 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -56,13 +56,11 @@ #include <asm/tlbflush.h> -//#define RMAP_DEBUG /* can be enabled only for debugging */ - struct kmem_cache *anon_vma_cachep; static inline void validate_anon_vma(struct vm_area_struct *find_vma) { -#ifdef RMAP_DEBUG +#ifdef CONFIG_DEBUG_VM struct anon_vma *anon_vma = find_vma->anon_vma; struct vm_area_struct *vma; unsigned int mapcount = 0; @@ -551,13 +549,14 @@ void page_add_file_rmap(struct page *page) void page_remove_rmap(struct page *page) { if (atomic_add_negative(-1, &page->_mapcount)) { - if (page_mapcount(page) < 0) { +#ifdef CONFIG_DEBUG_VM + if (unlikely(page_mapcount(page) < 0)) { printk (KERN_EMERG "Eeek! page_mapcount(page) went negative! (%d)\n", page_mapcount(page)); printk (KERN_EMERG " page->flags = %lx\n", page->flags); printk (KERN_EMERG " page->count = %x\n", page_count(page)); printk (KERN_EMERG " page->mapping = %p\n", page->mapping); } - +#endif BUG_ON(page_mapcount(page) < 0); /* * It would be tidy to reset the PageAnon mapping here, |