diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9bf6ce119d6dd212b65464cd07f8aa631c4e4af5..9ffa2badb706c3f909751cb65828f24cc476b0fd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3812,6 +3812,21 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, struct page *page; unsigned long mark; + /* + * CDM nodes get skipped if the requested gfp flag + * does not have __GFP_THISNODE set or the nodemask + * does not have any CDM nodes in case the nodemask + * is non NULL (explicit allocation requests from + * kernel or user process MPOL_BIND policy which has + * CDM nodes). + */ + if (is_cdm_node(zone->zone_pgdat->node_id)) { + if (!(gfp_mask & __GFP_THISNODE)) { + if (!ac->nodemask) + continue; + } + } + if (cpusets_enabled() && (alloc_flags & ALLOC_CPUSET) && !__cpuset_zone_allowed(zone, gfp_mask))