提交 3cde0f50 编写于 作者: L Lijun Fang 提交者: Xie XiuQi

mm/cdm: Fix compile error if not set NUMA config

hulk inclusion
category: bugfix
bugzilla: 16090
CVE: NA
-------------------

the CONFIG_COHERENT_DEVICE must depends on CONFIG_NUMA, if not, when
singly config COHERENT_DEVICE, it will cause compile error.

Fixes: a72a680ff761 ("mm: Tag VMA with VM_CDM flag explicitly during mbind(MPOL_BIND) and page fault")
Fixes: 5458fde3b255 ("mm: Ignore madvise(MADV_MERGEABLE) request for VM_CDM marked VMAs")
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NLi Zefan <lizefan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 199a4cda
...@@ -145,11 +145,10 @@ config ARCH_DISCARD_MEMBLOCK ...@@ -145,11 +145,10 @@ config ARCH_DISCARD_MEMBLOCK
config COHERENT_DEVICE config COHERENT_DEVICE
bool "coherent device memory" bool "coherent device memory"
def_bool n def_bool n
depends on CPUSETS && ARM64 depends on CPUSETS && ARM64 && NUMA
help help
Enable coherent device memory (CDM) support. Enable coherent device memory (CDM) support.
config NO_BOOTMEM config NO_BOOTMEM
bool bool
......
...@@ -890,9 +890,10 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, ...@@ -890,9 +890,10 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask,
int node = -1; int node = -1;
bool mbind_cdmnode = false; bool mbind_cdmnode = false;
#ifdef CONFIG_COHERENT_DEVICE
if (is_cdm_node(nid) && mpol != NULL && mpol->mode == MPOL_BIND) if (is_cdm_node(nid) && mpol != NULL && mpol->mode == MPOL_BIND)
mbind_cdmnode = true; mbind_cdmnode = true;
#endif
zonelist = node_zonelist(nid, gfp_mask); zonelist = node_zonelist(nid, gfp_mask);
retry_cpuset: retry_cpuset:
......
...@@ -2458,10 +2458,10 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start, ...@@ -2458,10 +2458,10 @@ 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)) if (is_cdm_vma(vma))
return 0; 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.
先完成此消息的编辑!
想要评论请 注册