From: Dave Jones 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 --- mm/rmap.c | 7 +++++++ 1 files changed, 7 insertions(+) diff -puN mm/rmap.c~rmap-additional-diagnostics-in-page_remove_rmap mm/rmap.c --- 25/mm/rmap.c~rmap-additional-diagnostics-in-page_remove_rmap Wed Jan 4 16:41:36 2006 +++ 25-akpm/mm/rmap.c Wed Jan 4 16:41:36 2006 @@ -514,6 +514,13 @@ void page_add_file_rmap(struct page *pag 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, _