aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 90c1439549fd..f4967910c967 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2034,6 +2034,14 @@ restart:
2034 */ 2034 */
2035 alloc_flags = gfp_to_alloc_flags(gfp_mask); 2035 alloc_flags = gfp_to_alloc_flags(gfp_mask);
2036 2036
2037 /*
2038 * Find the true preferred zone if the allocation is unconstrained by
2039 * cpusets.
2040 */
2041 if (!(alloc_flags & ALLOC_CPUSET) && !nodemask)
2042 first_zones_zonelist(zonelist, high_zoneidx, NULL,
2043 &preferred_zone);
2044
2037 /* This is the last chance, in general, before the goto nopage. */ 2045 /* This is the last chance, in general, before the goto nopage. */
2038 page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, 2046 page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist,
2039 high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, 2047 high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS,
@@ -2192,7 +2200,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
2192 2200
2193 get_mems_allowed(); 2201 get_mems_allowed();
2194 /* The preferred zone is used for statistics later */ 2202 /* The preferred zone is used for statistics later */
2195 first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone); 2203 first_zones_zonelist(zonelist, high_zoneidx,
2204 nodemask ? : &cpuset_current_mems_allowed,
2205 &preferred_zone);
2196 if (!preferred_zone) { 2206 if (!preferred_zone) {
2197 put_mems_allowed(); 2207 put_mems_allowed();
2198 return NULL; 2208 return NULL;