LWN.net Logo

rmap 30 fix bad mapcount

From:  Hugh Dickins <hugh@veritas.com>
To:  Andrew Morton <akpm@osdl.org>
Subject:  [PATCH] rmap 30 fix bad mapcount
Date:  Sat, 8 May 2004 23:04:04 +0100 (BST)
Cc:  Andrea Arcangeli <andrea@suse.de>, <linux-kernel@vger.kernel.org>

From: Andrea Arcangeli <andrea@suse.de>

page_alloc.c's bad_page routine should reset a bad mapcount; and it's
more revealing to show the bad mapcount than just the boolean mapped.

 page_alloc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

--- rmap29/mm/page_alloc.c	2004-05-05 13:29:08.000000000 +0100
+++ rmap30/mm/page_alloc.c	2004-05-08 20:55:38.593511352 +0100
@@ -73,9 +73,9 @@ static void bad_page(const char *functio
 {
 	printk(KERN_EMERG "Bad page state at %s (in process '%s', page %p)\n",
 		function, current->comm, page);
-	printk(KERN_EMERG "flags:0x%08lx mapping:%p mapped:%d count:%d\n",
+	printk(KERN_EMERG "flags:0x%08lx mapping:%p mapcount:%d count:%d\n",
 		(unsigned long)page->flags, page->mapping,
-		page_mapped(page), page_count(page));
+		(int)page->mapcount, page_count(page));
 	printk(KERN_EMERG "Backtrace:\n");
 	dump_stack();
 	printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n");
@@ -90,6 +90,7 @@ static void bad_page(const char *functio
 			1 << PG_writeback);
 	set_page_count(page, 0);
 	page->mapping = NULL;
+	page->mapcount = 0;
 }
 
 #ifndef CONFIG_HUGETLB_PAGE

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds