From: Nikita Panov <panov.nikita@huawei.com> Cache_ext framework project integration. Heavily inspired by "cache_ext: Customizing the Page Cache with eBPF" by Tal Zussman, Ioannis Zarkadas and others. This patchset allows users to load custom bpf policies to adjust page cache reclaim algorithm. Policy might be designed to reclaim specific files (filter by name) or an algorithm differ from LRU/MGLRU might be implemented. Additionaly, a refill mechanism was implemented. If the page was reclaimed through the cache_ext, the system has a lot of free mem, and the disk is not busy with IO at the moment, page might be refilled to the page cache. Nikita Panov (3): mm: Cache_ext framework krefilld: initial design and implementation cache_ext: Add examples to tools/cache_ext .../admin-guide/kernel-parameters.txt | 21 + Documentation/admin-guide/sysctl/vm.rst | 41 + arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + fs/drop_caches.c | 6 + fs/inode.c | 13 + fs/super.c | 20 +- include/linux/cache_ext.h | 259 ++++ include/linux/fs.h | 4 + include/linux/memcontrol.h | 26 + include/linux/mempolicy.h | 6 + include/linux/mm_types.h | 33 + include/linux/mmzone.h | 7 + include/linux/page_ext.h | 4 + include/linux/pagemap.h | 3 + include/linux/sched.h | 7 + include/linux/swap.h | 20 + include/linux/sysctl.h | 8 +- kernel/bpf/verifier.c | 129 +- kernel/sysctl.c | 38 +- mm/Kconfig | 11 + mm/Makefile | 1 + mm/cache_ext.c | 1335 +++++++++++++++++ mm/cache_ext_ds.c | 1050 +++++++++++++ mm/filemap.c | 12 +- mm/memcontrol.c | 48 + mm/mempolicy.c | 5 + mm/migrate.c | 16 +- mm/page_ext.c | 7 + mm/swap.c | 1 + mm/truncate.c | 12 +- mm/vmscan.c | 267 +++- mm/vmstat.c | 8 +- mm/workingset.c | 110 +- tools/cache_ext/.gitignore | 2 + tools/cache_ext/Makefile | 229 +++ tools/cache_ext/cache_ext_simple_fifo.bpf.c | 109 ++ tools/cache_ext/cache_ext_simple_fifo.c | 52 + .../cache_ext/include/cache_ext_common.bpf.h | 178 +++ 39 files changed, 4074 insertions(+), 26 deletions(-) create mode 100644 include/linux/cache_ext.h create mode 100644 mm/cache_ext.c create mode 100644 mm/cache_ext_ds.c create mode 100644 tools/cache_ext/.gitignore create mode 100644 tools/cache_ext/Makefile create mode 100644 tools/cache_ext/cache_ext_simple_fifo.bpf.c create mode 100644 tools/cache_ext/cache_ext_simple_fifo.c create mode 100644 tools/cache_ext/include/cache_ext_common.bpf.h -- 2.34.1