Re: [PATCH v2 6/7] mm, swap: remove swap slot cache

Baoquan He
2025-02-25T06:39:54Z

On 02/25/25 at 02:02am, Kairui Song wrote:
> From: Kairui Song <kasong@tencent.com>
>
> Slot cache is no longer needed now, removing it and all related code.
>
> - vm-scalability with: `usemem --init-time -O -y -x -R -31 1G`,
> 12G memory cgroup using simulated pmem as SWAP (32G pmem, 32 CPUs),
> 16 test runs for each case, measuring the total throughput:
>
> Before (KB/s) (stdev) After (KB/s) (stdev)
> Random (4K): 424907.60 (24410.78) 414745.92 (34554.78)
> Random (64K): 163308.82 (11635.72) 167314.50 (18434.99)
> Sequential (4K, !-R): 6150056.79 (103205.90) 6321469.06 (115878.16)
>
> The performance changes are below noise level.
>
> - Build linux kernel with make -j96, using 4K folio with 1.5G memory
> cgroup limit and 64K folio with 2G memory cgroup limit, on top of tmpfs,
> 12 test runs, measuring the system time:
>
> Before (s) (stdev) After (s) (stdev)
> make -j96 (4K): 6445.69 (61.95) 6408.80 (69.46)
> make -j96 (64K): 6841.71 (409.04) 6437.99 (435.55)
>
> Similar to above, 64k mTHP case showed a slight improvement.
>
> Signed-off-by: Kairui Song <kasong@tencent.com>
> ---
> include/linux/swap.h | 2 -
> include/linux/swap_slots.h | 28 ----
> mm/Makefile | 2 +-
> mm/swap_slots.c | 295 -------------------------------------
> mm/swap_state.c | 8 +-
> mm/swapfile.c | 193 +++++++++---------------
> 6 files changed, 71 insertions(+), 457 deletions(-)
> delete mode 100644 include/linux/swap_slots.h
> delete mode 100644 mm/swap_slots.c