Commit 7f67a4ea authored by Zhou Guanghui's avatar Zhou Guanghui Committed by Jian Zhang
Browse files

mm: fix alloc CDM node memory for MPOL_BIND

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: default avatarZhou Guanghui <zhouguanghui1@huawei.com>
parent c1530afc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3867,7 +3867,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;