提交 148b50b7 编写于 作者: A Anshuman Khandual 提交者: Xie XiuQi

mm: Ignore cpuset enforcement when allocation flag has __GFP_THISNODE

euler inclusion
category: feature
bugzilla: 11082
CVE: NA
-------------------

__GFP_THISNODE specifically asks the memory to be allocated from the given
node. Not all the requests that end up in __alloc_pages_nodemask() are
originated from the process context where cpuset makes more sense. The
current condition enforces cpuset limitation on every allocation whether
originated from process context or not which prevents __GFP_THISNODE
mandated allocations to come from the specified node. In context of the
coherent device memory node which is isolated from all cpuset nodemask
in the system, it prevents the only way of allocation into it which has
been changed with this patch.
Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Nzhong jiang <zhongjiang@huawei.com>
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: Nzhong jiang <zhongjiang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 84919aed
...@@ -4335,7 +4335,11 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, ...@@ -4335,7 +4335,11 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
ac->nodemask = nodemask; ac->nodemask = nodemask;
ac->migratetype = gfpflags_to_migratetype(gfp_mask); ac->migratetype = gfpflags_to_migratetype(gfp_mask);
#ifdef CONFIG_COHERENT_DEVICE
if (cpusets_enabled() && !(*alloc_mask & __GFP_THISNODE)) {
#else
if (cpusets_enabled()) { if (cpusets_enabled()) {
#endif
*alloc_mask |= __GFP_HARDWALL; *alloc_mask |= __GFP_HARDWALL;
if (!ac->nodemask) if (!ac->nodemask)
ac->nodemask = &cpuset_current_mems_allowed; ac->nodemask = &cpuset_current_mems_allowed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册