diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ecf663358b0d3d732a405be72d6098c9ee85e469..5c469c1dfb8bd420c9c0b353cfb24f74a374afa4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3636,6 +3636,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: