]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Expanded bad page handling
authorAndrew Morton <akpm@digeo.com>
Fri, 22 Nov 2002 03:31:03 +0000 (19:31 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Fri, 22 Nov 2002 03:31:03 +0000 (19:31 -0800)
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.

mm/page_alloc.c

index 0158427d2502691cea88255eda0ca34cf311d0b9..7265ce82ebb98ac614ef4522490cbab052820119 100644 (file)
@@ -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;
 }
 
 /*