Re: [PATCH] Fixes for prep_zero_page

From: Chris Wright
Date: Sun Jan 09 2005 - 17:51:33 EST


* Zwane Mwaikambo (zwane@xxxxxxxxxxxxxxxx) wrote:
> On Sun, 9 Jan 2005, Andrew Morton wrote:
> > Can't we simply move the page zeroing to the very end of __alloc_pages()?
>
> Ok, i've changed that bit to something like;

I did it the other way around, and moved kernel_map_pages to prep_new_page
so it's called before zeroing to keep that with the other prep bits
in buffered_rmqueue. Made sense to me that kernel_map_pages is part of
prepping a new page, but this isn't my area, so I could be way off ;-)
It works for me with DEBUG_PAGEALLOC enabled.

===== mm/page_alloc.c 1.251 vs edited =====
--- 1.251/mm/page_alloc.c 2005-01-07 21:44:07 -08:00
+++ edited/mm/page_alloc.c 2005-01-09 14:36:38 -08:00
@@ -413,6 +413,7 @@ static void prep_new_page(struct page *p
1 << PG_checked | 1 << PG_mappedtodisk);
page->private = 0;
set_page_refs(page, order);
+ kernel_map_pages(page, 1 << order, 1);
}

/*
@@ -823,7 +824,6 @@ nopage:
return NULL;
got_pg:
zone_statistics(zonelist, z);
- kernel_map_pages(page, 1 << order, 1);
return page;
}

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