From 8974c422b78cbe0ea51bcd738420ac51ebd1e8df Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Tue, 25 Jan 2011 15:07:20 -0800 Subject: [PATCH] --- yaml --- r: 232409 b: refs/heads/master c: f33261d75b88f55a08e6a9648cef73509979bfba h: refs/heads/master i: 232407: 6fc1a702acf7913163011ff32806ec1c4aca21ef v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 12 +++++++++++- trunk/mm/vmscan.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b54b0c297458..a93225488d27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f542e3dd90a96ee0f8fcb8173cb4104f5f753e6 +refs/heads/master: f33261d75b88f55a08e6a9648cef73509979bfba diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 90c1439549fd..f4967910c967 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -2034,6 +2034,14 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, */ alloc_flags = gfp_to_alloc_flags(gfp_mask); + /* + * Find the true preferred zone if the allocation is unconstrained by + * cpusets. + */ + if (!(alloc_flags & ALLOC_CPUSET) && !nodemask) + first_zones_zonelist(zonelist, high_zoneidx, NULL, + &preferred_zone); + /* This is the last chance, in general, before the goto nopage. */ page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, @@ -2192,7 +2200,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, get_mems_allowed(); /* The preferred zone is used for statistics later */ - first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone); + first_zones_zonelist(zonelist, high_zoneidx, + nodemask ? : &cpuset_current_mems_allowed, + &preferred_zone); if (!preferred_zone) { put_mems_allowed(); return NULL; diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index f5d90dedebba..148c6e630df2 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -2083,7 +2083,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, struct zone *preferred_zone; first_zones_zonelist(zonelist, gfp_zone(sc->gfp_mask), - NULL, &preferred_zone); + &cpuset_current_mems_allowed, + &preferred_zone); wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/10); } }