From 74706f34e144e1bf95914d2e36eb29d40f1d8e14 Mon Sep 17 00:00:00 2001 From: liubo Date: Tue, 2 Mar 2021 19:26:03 +0800 Subject: [PATCH] memig: fix compile error when CONFIG_NUMA is turned off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit euleros inclusion category: feature feature: memig bugzilla: 48246 ------------------------------------------------- fix compile error when CONFIG_NUMA is turned off on Raspberry platform. compile info: mm/vmscan.c: In function ‘get_page_from_vaddr’: mm/vmscan.c:4350:40: error: implicit declaration of function ‘vma_migratable’; did you mean ‘rq_mergeable’? [-Werror=implicit-function-declaration] This patch solves the problem of compilation errors introduced by memig into the interface in the vmscan.c file. Delete dependency on NUMA for CONFIG_MEMIG_SWAP, and use vma->vm_flags & VM_LOCKED for judgement. Signed-off-by: liubo Reviewed-by: Jing Xiangfeng Signed-off-by: Zheng Zengkai --- arch/arm64/configs/openeuler_defconfig | 4 ++-- arch/x86/configs/openeuler_defconfig | 4 ++-- fs/proc/Makefile | 4 ++-- lib/Kconfig | 4 ++-- mm/vmscan.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 8f9106fc88de..33a2aaba717e 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -7098,5 +7098,5 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y CONFIG_MPAM=y CONFIG_RESCTRL=y CONFIG_ACPI_MPAM=y -CONFIG_MEMIG_SCAN_MODULE=m -CONFIG_MEMIG_SWAP_MODULE=m +CONFIG_MEMIG_SCAN=m +CONFIG_MEMIG_SWAP=m diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig index 33f91d148906..ca3fb8a71f4a 100644 --- a/arch/x86/configs/openeuler_defconfig +++ b/arch/x86/configs/openeuler_defconfig @@ -8489,5 +8489,5 @@ CONFIG_ARCH_HAS_KCOV=y # CONFIG_HYPERV_TESTING is not set # end of Kernel Testing and Coverage # end of Kernel hacking -CONFIG_MEMIG_SCAN_MODULE=m -CONFIG_MEMIG_SWAP_MODULE=m +CONFIG_MEMIG_SCAN=m +CONFIG_MEMIG_SWAP=m diff --git a/fs/proc/Makefile b/fs/proc/Makefile index e6747114a75b..1da3ddf423c0 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -34,5 +34,5 @@ proc-$(CONFIG_PROC_VMCORE) += vmcore.o proc-$(CONFIG_PRINTK) += kmsg.o proc-$(CONFIG_PROC_PAGE_MONITOR) += page.o proc-$(CONFIG_BOOT_CONFIG) += bootconfig.o -obj-$(CONFIG_MEMIG_SCAN_MODULE) += memig_scan.o -obj-$(CONFIG_MEMIG_SWAP_MODULE) += memig_swap.o +obj-$(CONFIG_MEMIG_SCAN) += memig_scan.o +obj-$(CONFIG_MEMIG_SWAP) += memig_swap.o diff --git a/lib/Kconfig b/lib/Kconfig index 87bec73787dc..bf2f8e546f4f 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -660,13 +660,13 @@ config PARMAN config OBJAGG tristate "objagg" if COMPILE_TEST -config MEMIG_SCAN_MODULE +config MEMIG_SCAN tristate "module: memig page scan for memig support" help memig page scan feature used to scan the virtual address of the target process -config MEMIG_SWAP_MODULE +config MEMIG_SWAP tristate "module: memig page swap for memig support" help memig page swap feature diff --git a/mm/vmscan.c b/mm/vmscan.c index e77ad460223e..7760d50e6a9f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4352,7 +4352,7 @@ struct page *get_page_from_vaddr(struct mm_struct *mm, unsigned long vaddr) down_read(&mm->mmap_lock); vma = find_vma(mm, vaddr); - if (!vma || vaddr < vma->vm_start || !vma_migratable(vma)) { + if (!vma || vaddr < vma->vm_start || vma->vm_flags & VM_LOCKED) { up_read(&mm->mmap_lock); return NULL; } -- GitLab