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

mm: Exclude CDM marked VMAs from auto NUMA

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

Kernel cannot track device memory accesses behind VMAs containing CDM
memory. Hence all the VM_CDM marked VMAs should not be part of the auto
NUMA migration scheme. This patch also adds a new function is_cdm_vma()
to detect any VMA marked with flag VM_CDM.
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>
上级 ebde394a
...@@ -181,6 +181,20 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol); ...@@ -181,6 +181,20 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol);
extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol);
#ifdef CONFIG_COHERENT_DEVICE
static inline bool is_cdm_vma(struct vm_area_struct *vma)
{
if (vma->vm_flags & VM_CDM)
return true;
return false;
}
#else
static inline bool is_cdm_vma(struct vm_area_struct *vma)
{
return false;
}
#endif
/* Check if a vma is migratable */ /* Check if a vma is migratable */
extern bool vma_migratable(struct vm_area_struct *vma); extern bool vma_migratable(struct vm_area_struct *vma);
......
...@@ -2836,7 +2836,8 @@ static void task_numa_work(struct callback_head *work) ...@@ -2836,7 +2836,8 @@ static void task_numa_work(struct callback_head *work)
} }
for (; vma; vma = vma->vm_next) { for (; vma; vma = vma->vm_next) {
if (!vma_migratable(vma) || !vma_policy_mof(vma) || if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { is_vm_hugetlb_page(vma) || is_cdm_vma(vma) ||
(vma->vm_flags & VM_MIXEDMAP)) {
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册