Commit 67d9df19 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent 75177faa
...@@ -72,6 +72,17 @@ static void bad_page(const char *function, struct page *page) ...@@ -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", printk("flags:0x%08lx mapping:%p mapped:%d count:%d\n",
page->flags, page->mapping, page->flags, page->mapping,
page_mapped(page), page_count(page)); 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;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment