Commit 334795ec authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[PATCH] bad_page: clear reclaim and slab

Since free_pages_check complains if PG_reclaim or PG_slab is set, bad_page
ought to clear them to avoid repetitive reports (Nikita noticed this too).
Let prep_new_page check page_count and PG_slab as free_pages_check does.
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 45918e1a
...@@ -105,11 +105,13 @@ static void bad_page(const char *function, struct page *page) ...@@ -105,11 +105,13 @@ static void bad_page(const char *function, struct page *page)
printk(KERN_EMERG "Backtrace:\n"); printk(KERN_EMERG "Backtrace:\n");
dump_stack(); dump_stack();
printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n"); printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n");
page->flags &= ~(1 << PG_private | page->flags &= ~(1 << PG_lru |
1 << PG_private |
1 << PG_locked | 1 << PG_locked |
1 << PG_lru |
1 << PG_active | 1 << PG_active |
1 << PG_dirty | 1 << PG_dirty |
1 << PG_reclaim |
1 << PG_slab |
1 << PG_swapcache | 1 << PG_swapcache |
1 << PG_writeback); 1 << PG_writeback);
set_page_count(page, 0); set_page_count(page, 0);
...@@ -440,14 +442,17 @@ void set_page_refs(struct page *page, int order) ...@@ -440,14 +442,17 @@ void set_page_refs(struct page *page, int order)
*/ */
static void prep_new_page(struct page *page, int order) static void prep_new_page(struct page *page, int order)
{ {
if (page->mapping || page_mapcount(page) || if ( page_mapcount(page) ||
(page->flags & ( page->mapping != NULL ||
page_count(page) != 0 ||
(page->flags & (
1 << PG_lru |
1 << PG_private | 1 << PG_private |
1 << PG_locked | 1 << PG_locked |
1 << PG_lru |
1 << PG_active | 1 << PG_active |
1 << PG_dirty | 1 << PG_dirty |
1 << PG_reclaim | 1 << PG_reclaim |
1 << PG_slab |
1 << PG_swapcache | 1 << PG_swapcache |
1 << PG_writeback ))) 1 << PG_writeback )))
bad_page(__FUNCTION__, page); bad_page(__FUNCTION__, page);
......
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