* [PATCH] mm, page_alloc: Restore the original nodemask if the fast path allocation failed
@ 2016-05-04 14:36 ` Mel Gorman
0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2016-05-04 14:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: Vlastimil Babka, Jesper Dangaard Brouer, Linux-MM, LKML
(Andrew, this is on top of the pagealloc optimisation series in mmotm. It
could be classed as a fix-up but it's subtle enough that it deserves its
own changelog. "Clever" fixes had other consequences.)
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.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 79100583b9de..ec5155ab1482 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3637,6 +3637,12 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
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:
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mm, page_alloc: Restore the original nodemask if the fast path allocation failed
@ 2016-05-04 14:36 ` Mel Gorman
0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2016-05-04 14:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: Vlastimil Babka, Jesper Dangaard Brouer, Linux-MM, LKML
(Andrew, this is on top of the pagealloc optimisation series in mmotm. It
could be classed as a fix-up but it's subtle enough that it deserves its
own changelog. "Clever" fixes had other consequences.)
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.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 79100583b9de..ec5155ab1482 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3637,6 +3637,12 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
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:
--
Mel Gorman
SUSE Labs
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-04 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 14:36 [PATCH] mm, page_alloc: Restore the original nodemask if the fast path allocation failed Mel Gorman
2016-05-04 14:36 ` Mel Gorman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.