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

mm: Ignore madvise(MADV_MERGEABLE) request for VM_CDM marked VMAs

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

VMA containing CDM memory should be excluded from KSM merging. This change
makes madvise(MADV_MERGEABLE) request on target VMA to be ignored.
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>
上级 dcb0ac35
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/oom.h> #include <linux/oom.h>
#include <linux/numa.h> #include <linux/numa.h>
#include <linux/mempolicy.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include "internal.h" #include "internal.h"
...@@ -2454,6 +2455,11 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start, ...@@ -2454,6 +2455,11 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
if (vma_is_dax(vma)) if (vma_is_dax(vma))
return 0; return 0;
#ifdef CONFIG_COHERENT_DEVICE
if (is_cdm_vma(vma))
return 0;
#endif
#ifdef VM_SAO #ifdef VM_SAO
if (*vm_flags & VM_SAO) if (*vm_flags & VM_SAO)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册