Skip to content

Commit

Permalink
[PATCH] rmap: additional diagnostics in page_remove_rmap()
Browse files Browse the repository at this point in the history
We seem to be hitting this assertion failure too often for it to be
hardware bugs.

Cc: Hugh Dickins <[email protected]>
Cc: Nick Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dave Jones authored and Linus Torvalds committed Jan 9, 2006
1 parent cd105df commit ef2bf0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ef2bf0d

Please sign in to comment.