]> Git Repo - linux.git/commitdiff
mm, page_alloc: restore the original nodemask if the fast path allocation failed
authorMel Gorman <[email protected]>
Fri, 20 May 2016 00:14:44 +0000 (17:14 -0700)
committerLinus Torvalds <[email protected]>
Fri, 20 May 2016 02:12:14 +0000 (19:12 -0700)
The page allocator fast path uses either the requested nodemask or
cpuset_current_mems_allowed if cpusets are enabled.  If the allocation
context allows watermarks to be ignored then it can also ignore memory
policies.  However, on entering the allocator slowpath the nodemask may
still be cpuset_current_mems_allowed and the policies are enforced.
This patch resets the nodemask appropriately before entering the
slowpath.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vlastimil Babka <[email protected]>
Signed-off-by: Mel Gorman <[email protected]>
Cc: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c

index ecf663358b0d3d732a405be72d6098c9ee85e469..5c469c1dfb8bd420c9c0b353cfb24f74a374afa4 100644 (file)
@@ -3636,6 +3636,12 @@ retry_cpuset:
        alloc_mask = memalloc_noio_flags(gfp_mask);
        ac.spread_dirty_pages = false;
 
+       /*
+        * Restore the original nodemask if it was potentially replaced with
+        * &cpuset_current_mems_allowed to optimize the fast-path attempt.
+        */
+       if (cpusets_enabled())
+               ac.nodemask = nodemask;
        page = __alloc_pages_slowpath(alloc_mask, order, &ac);
 
 no_zone:
This page took 0.066476 seconds and 4 git commands to generate.