From: Paul Jackson The __GFP_HARDWALL flag logic is the same in mm/page_alloc.c for all calls to get_page_from_freelist(). Save a couple of lines of source code and a few bytes of text by only computing it once, inside get_page_from_freelist(), instead of passing it in each time. The key improvement is that it reduces the logic in __alloc_pages() by another detail. There is now -no- cpuset specific confinement logic in __alloc_pages(). It is all more generically stated in get_page_from_freelist(). Signed-off-by: Paul Jackson Signed-off-by: Andrew Morton --- mm/page_alloc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -puN mm/page_alloc.c~mm-simplify-__alloc_pages-cpuset-hardwall-logic mm/page_alloc.c --- 25/mm/page_alloc.c~mm-simplify-__alloc_pages-cpuset-hardwall-logic Mon Nov 14 14:43:19 2005 +++ 25-akpm/mm/page_alloc.c Mon Nov 14 14:43:19 2005 @@ -809,6 +809,8 @@ get_page_from_freelist(gfp_t gfp_mask, u */ do { if (!(alloc_flags & ALLOC_MUSTHAVE)) { + if (alloc_flags == ALLOC_DONT_DIP) + gfp_mask |= __GFP_HARDWALL; if (!cpuset_zone_allowed(*z, gfp_mask)) continue; if (!zone_watermark_ok(*z, order, (*z)->pages_low, @@ -850,7 +852,7 @@ __alloc_pages(gfp_t gfp_mask, unsigned i return NULL; } restart: - page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, + page = get_page_from_freelist(gfp_mask, order, zonelist, ALLOC_DONT_DIP); if (page) goto got_pg; @@ -928,7 +930,7 @@ rebalance: * a parallel oom killing, we must fail if we're still * under heavy pressure. */ - page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, + page = get_page_from_freelist(gfp_mask, order, zonelist, ALLOC_DONT_DIP); if (page) goto got_pg; _