提交 8877e9e4 编写于 作者: A Anshuman Khandual 提交者: Xie XiuQi

mm: Enable Buddy allocation isolation for CDM nodes

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

This implements allocation isolation for CDM nodes in buddy allocator by
discarding CDM memory zones all the time except in the cases where the gfp
flag has got __GFP_THISNODE or the nodemask contains CDM nodes in cases
where it is non NULL (explicit allocation request in the kernel or user
process MPOL_BIND policy based requests).
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>
上级 023d1127
......@@ -3284,6 +3284,21 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
struct page *page;
unsigned long mark;
/*
* CDM nodes get skipped if the requested gfp flag
* does not have __GFP_THISNODE set or the nodemask
* does not have any CDM nodes in case the nodemask
* is non NULL (explicit allocation requests from
* kernel or user process MPOL_BIND policy which has
* CDM nodes).
*/
if (is_cdm_node(zone->zone_pgdat->node_id)) {
if (!(gfp_mask & __GFP_THISNODE)) {
if (!ac->nodemask)
continue;
}
}
if (cpusets_enabled() &&
(alloc_flags & ALLOC_CPUSET) &&
!__cpuset_zone_allowed(zone, gfp_mask))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册