From: Zhou Guanghui zhouguanghui1@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I612UG CVE: NA
------------------------------------------------------
Memory can be allocated from a specified CDM node only when it is allowed to apply for memory from the CDM node. Otherwise, memory will be allocated from other non-CDM nodes that are not allowed by th cpuset.
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d090465de32b..085aeecca0c6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3873,7 +3873,8 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, (alloc_flags & ALLOC_CPUSET) && !__cpuset_zone_allowed(zone, gfp_mask) #ifdef CONFIG_COHERENT_DEVICE - && !(alloc_flags & ALLOC_CDM) + && (!is_cdm_node(zone->zone_pgdat->node_id) || + !(alloc_flags & ALLOC_CDM)) #endif ) continue;