提交 c80f1cb2 编写于 作者: A Anshuman Khandual 提交者: Zheng Zengkai

mm: Change mbind(MPOL_BIND) implementation for CDM nodes

ascend inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4JMLR
CVE: NA
-------------------

CDM nodes need a way of explicit memory allocation mechanism from the user
space. After the previous FALLBACK zonelist rebuilding process changes, the
mbind(MPOL_BIND) based allocation request fails on the CDM node. This is
because allocation requesting local node's FALLBACK zonelist is selected
for further nodemask processing targeted at MPOL_BIND implementation. As
the CDM node's zones are not part of any other regular node's FALLBACK
zonelist, the allocation simply fails without getting any valid zone. The
allocation requesting node is always going to be different than the CDM
node which does not have any CPU. Hence MPOL_MBIND implementation must
choose given CDM node's FALLBACK zonelist instead of the requesting local
node's FALLBACK zonelist. This implements that change.
Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b49907cc
...@@ -1935,6 +1935,13 @@ static int policy_node(gfp_t gfp, struct mempolicy *policy, int nd) ...@@ -1935,6 +1935,13 @@ static int policy_node(gfp_t gfp, struct mempolicy *policy, int nd)
WARN_ON_ONCE(policy->mode == MPOL_BIND && (gfp & __GFP_THISNODE)); WARN_ON_ONCE(policy->mode == MPOL_BIND && (gfp & __GFP_THISNODE));
} }
if (policy->mode == MPOL_BIND) {
if (unlikely(!node_isset(nd, policy->v.nodes))) {
if (is_cdm_node(first_node(policy->v.nodes)))
nd = first_node(policy->v.nodes);
}
}
return nd; return nd;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册