From: Andrew Morton Date: Fri, 22 Nov 2002 03:31:03 +0000 (-0800) Subject: [PATCH] Expanded bad page handling X-Git-Tag: v2.5.49~2^2~10 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=67d9df19a06f1a1145a789a5bc6407c5cc715ae6;p=history.git [PATCH] Expanded bad page handling The page allocator has traditionally just gone BUG when it sees a page in a bad state. This is usually due to hardware errors, sometimes software errors. I'm proposing that we not go BUG() any more, but print lots (and lots) of diagnostic info and try to continue. Might be a bit controversial. --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0158427d2502..7265ce82ebb9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -72,6 +72,17 @@ static void bad_page(const char *function, struct page *page) printk("flags:0x%08lx mapping:%p mapped:%d count:%d\n", page->flags, page->mapping, page_mapped(page), page_count(page)); + printk("Backtrace:\n"); + dump_stack(); + printk("Trying to fix it up, but a reboot is needed\n"); + page->flags &= ~(1 << PG_private | + 1 << PG_locked | + 1 << PG_lru | + 1 << PG_active | + 1 << PG_dirty | + 1 << PG_writeback); + set_page_count(page, 0); + page->mapping = NULL; } /*