From: ZhangPeng zhangpeng362@huawei.com
This patch series support userswap feature including registration, unregistration, swap-out and swap-in.
Userswap feature depends on CONFIG_USERSWAP and can be enabled by cmdline enable_userswap.
We tested the concurrent scenario of multi-threaded page fault and multi-threaded swap-in in the uswap demo;and the remapping in the swap-out phase and the copy-free function in the swap-in phase were ok. During the test, related debugging functions including CONFIG_DEBUG_VM, lockdep, slub debug, kasan and kmemleak are enabled.
ChangeLog: v1->v2: - enable CONFIG_USERSWAP for openeuler_defconfig
ZhangPeng (7): mm/userswap: add VM_USWAP and SWP_USERSWAP_ENTRY mm/userswap: add enable_userswap boot option mm/userswap: introduce MREMAP_USWAP_SET_PTE mm/userswap: support userswap via userfaultfd mm/userswap: introduce UFFDIO_COPY_MODE_DIRECT_MAP mm/userswap: provide cpu info in userfault msg mm/userswap: openeuler_defconfig: enable userswap
arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + fs/proc/task_mmu.c | 3 + fs/userfaultfd.c | 43 +- include/linux/mm.h | 8 + include/linux/swap.h | 14 +- include/linux/swapops.h | 16 + include/linux/userfaultfd_k.h | 5 + include/linux/userswap.h | 60 +++ include/trace/events/mmflags.h | 7 + include/uapi/linux/mman.h | 1 + include/uapi/linux/userfaultfd.h | 3 + mm/Kconfig | 10 + mm/Makefile | 1 + mm/memory.c | 8 + mm/mremap.c | 8 +- mm/userfaultfd.c | 12 + mm/userswap.c | 552 +++++++++++++++++++++++++ 18 files changed, 747 insertions(+), 6 deletions(-) create mode 100644 include/linux/userswap.h create mode 100644 mm/userswap.c