From: Zhou Guanghui zhouguanghui1@huawei.com
ascend inclusion category: doc bugzilla: NA CVE: NA
-------------------------------------------------------
commit(bd177f8f0548f): Only __GFP_THISNODE marked allocations will come from the CDM node.
Therefore, when we alloc normal hugepages, if __GFP_THISNODE is marked, hugepages can be applied for from the specified nid.
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- mm/hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 375157c7acadf..962a30ab86d85 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -918,7 +918,8 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, bool mbind_cdmnode = false;
#ifdef CONFIG_COHERENT_DEVICE - if (is_cdm_node(nid) && mpol != NULL && mpol->mode == MPOL_BIND) + if (is_cdm_node(nid) && ((mpol != NULL && mpol->mode == MPOL_BIND) || + (gfp_mask & __GFP_THISNODE))) mbind_cdmnode = true; #endif zonelist = node_zonelist(nid, gfp_mask);