From: Ma Wupeng mawupeng1@huawei.com
Introduction
============
Memory reliable feature is a memory tiering mechanism. It is based on kernel mirror feature, which splits memory into two separate regions, mirrored(reliable) region and non-mirrored (non-reliable) region.
for kernel mirror feature:
- allocate kernel memory from mirrored region by default - allocate user memory from non-mirrored region by default
non-mirrored region will be arranged into ZONE_MOVABLE.
for kernel reliable feature, it has additional features below:
- normal user tasks never alloc memory from mirrored region with userspace apis(malloc, mmap, etc.) - special user tasks will allocate memory from mirrored region by default - shmem/pagecache allocate memory from mirrored region by default - upper limit of mirrored region allcated for user tasks, shmem and page cache
Support Reliable fallback mechanism which allows special user tasks, shmem and page cache can fallback to alloc non-mirrored region, it's the default setting.
In order to fulfil the goal
- GFP_KERNEL flag added for task to alloc memory from mirrored region. - the high_zoneidx for special user tasks/shmem/pagecache is set to ZONE_NORMAL to alloc memory from mirrored region. - normal user tasks can only alloc memory from ZONE_MOVABLE.
Changelog since v1: - update bugzilla url.
Chen Wandun (1): mm: mem_reliable: Alloc pagecache from reliable region
Ma Wupeng (16): proc: introduce proc_hide_ents to hide proc files efi: Disable mirror feature during crashkernel mm: mem_reliable: Introduce memory reliable mm: mem_reliable: Alloc task memory from reliable region mm: mem_reliable: Add memory reliable support during hugepaged collapse mm/memblock: Introduce ability to alloc memory from specify memory region mm/hugetlb: Allocate non-mirrored memory by default mm: mem_reliable: Count reliable page cache usage mm: mem_reliable: Count reliable shmem usage mm: mem_reliable: Show reliable meminfo mm: mem_reliable: Add limiting the usage of reliable memory mm: mem_reliable: Introduce fallback mechanism for memory reliable proc: mem_reliable: Count reliable memory usage of reliable tasks mm: mem_reliable: Introduce proc interface to disable memory reliable features mm: mem_reliable: Show debug info about memory reliable if oom occurs config: enable MEMORY_RELIABLE by default
Peng Wu (1): mm: mem_reliable: Add cmdline reliable_debug to enable separate feature
Zhou Guanghui (1): shmem: mem_reliable: Alloc shmem from reliable region
.../admin-guide/kernel-parameters.txt | 15 +- Documentation/filesystems/proc.rst | 30 ++ arch/arm64/configs/openeuler_defconfig | 1 + fs/proc/Makefile | 1 + fs/proc/base.c | 21 +- fs/proc/mem_reliable.c | 100 ++++ fs/proc/meminfo.c | 2 + fs/proc/task_mmu.c | 1 + include/linux/gfp.h | 6 + include/linux/gfp_types.h | 10 +- include/linux/mem_reliable.h | 261 ++++++++++ include/linux/memblock.h | 6 + include/linux/mm.h | 3 + include/linux/mm_inline.h | 6 + include/linux/mm_types.h | 4 + include/linux/mmzone.h | 5 + include/linux/sched.h | 5 + include/trace/events/mmflags.h | 3 +- kernel/events/uprobes.c | 2 + mm/Kconfig | 17 + mm/Makefile | 1 + mm/filemap.c | 11 +- mm/huge_memory.c | 4 + mm/hugetlb.c | 18 +- mm/khugepaged.c | 18 + mm/ksm.c | 2 + mm/mem_reliable.c | 473 ++++++++++++++++++ mm/memblock.c | 92 +++- mm/memory.c | 10 + mm/migrate.c | 5 + mm/migrate_device.c | 1 + mm/mm_init.c | 34 +- mm/page_alloc.c | 175 ++++++- mm/rmap.c | 7 + mm/shmem.c | 11 + mm/show_mem.c | 1 + mm/swapfile.c | 1 + mm/userswap.c | 4 + mm/vmscan.c | 2 + tools/perf/builtin-kmem.c | 1 + 40 files changed, 1342 insertions(+), 28 deletions(-) create mode 100644 fs/proc/mem_reliable.c create mode 100644 include/linux/mem_reliable.h create mode 100644 mm/mem_reliable.c