euleros inclusion category: feature feature: memig bugzilla: https://gitee.com/openeuler/kernel/issues/I7RO5Q Reference: https://gitee.com/openeuler/kernel/commit/74706f34e144e1bf95914d2e36eb29d40f...
-------------------------------------------------
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 liubo254@huawei.com Reviewed-by: Jing Xiangfeng jingxiangfeng@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- 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 2f3b7e13d513..88883eb1a192 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -7805,8 +7805,8 @@ CONFIG_FUNCTION_ERROR_INJECTION=y CONFIG_ARCH_HAS_KCOV=y # CONFIG_RUNTIME_TESTING_MENU is not set CONFIG_ARCH_USE_MEMTEST=y -CONFIG_MEMIG_SCAN_MODULE=m -CONFIG_MEMIG_SWAP_MODULE=m +CONFIG_MEMIG_SCAN=m +CONFIG_MEMIG_SWAP=m # CONFIG_MEMTEST is not set # end of Kernel Testing and Coverage
diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig index 32c19f6a1ee3..2f40409bd790 100644 --- a/arch/x86/configs/openeuler_defconfig +++ b/arch/x86/configs/openeuler_defconfig @@ -9043,8 +9043,8 @@ CONFIG_ARCH_HAS_KCOV=y # CONFIG_KCOV is not set # CONFIG_RUNTIME_TESTING_MENU is not set CONFIG_ARCH_USE_MEMTEST=y -CONFIG_MEMIG_SCAN_MODULE=m -CONFIG_MEMIG_SWAP_MODULE=m +CONFIG_MEMIG_SCAN=m +CONFIG_MEMIG_SWAP=m # CONFIG_MEMTEST is not set # CONFIG_HYPERV_TESTING is not set # end of Kernel Testing and Coverage 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 b341e880adf3..041103e5519c 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -728,13 +728,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 9287be69e468..ba95fe8afff7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -8146,7 +8146,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; }