From: Dave Jones Date: Sun, 8 Jan 2006 09:01:00 +0000 (-0800) Subject: [PATCH] rmap: additional diagnostics in page_remove_rmap() X-Git-Tag: MMI-PSA29.97-13-9~53609 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef2bf0dc8675e14cf8cba3b7fb9f48d72640a70e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] rmap: additional diagnostics in page_remove_rmap() We seem to be hitting this assertion failure too often for it to be hardware bugs. Cc: Hugh Dickins Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/rmap.c b/mm/rmap.c index 6f3f7db27128..66ec43053a4d 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -514,6 +514,13 @@ 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) { + 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); + } + BUG_ON(page_mapcount(page) < 0); /* * It would be tidy to reset the PageAnon mapping here,