mm-swap_slots-remove-slot-cache-for-freeing-path.patch removed from -mm tree
The quilt patch titled
Subject: mm, swap_slots: remove slot cache for freeing path
has been removed from the -mm tree. Its filename was
mm-swap_slots-remove-slot-cache-for-freeing-path.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Kairui Song <[email protected]>
Subject: mm, swap_slots: remove slot cache for freeing path
Date: Tue, 14 Jan 2025 01:57:32 +0800
The slot cache for freeing path is mostly for reducing the overhead of si->lock. As we have basically eliminated the si->lock usage for freeing path, it can be removed.
This helps simplify the code, and avoids swap entries from being hold in cache upon freeing. The delayed freeing of entries have been causing trouble for further optimizations for zswap [1] and in theory will also cause more fragmentation, and extra overhead.
Test with build linux kernel showed both performance and fragmentation is better without the cache:
tiem make -j96 / 768M memcg, 4K pages, 10G ZRAM, avg of 4 test run::
Before:
Sys time: 36047.78, Real time: 472.43
After: (-7.6% sys time, -7.3% real time)
Sys time: 33314.76, Real time: 437.67
time make -j96 / 1152M memcg, 64K mTHP, 10G ZRAM, avg of 4 test run:
Before:
Sys time: 46859.04, Real time: 562.63 hugepages-64kB/stats/swpout: 1783392 hugepages-64kB/stats/swpout_fallback: 240875
After: (-23.3% sys time, -21.3% real time)
Sys time: 35958.87, Real time: 442.69 hugepages-64kB/stats/swpout: 1866267 hugepages-64kB/stats/swpout_fallback: 158330
Sequential SWAP should be also slightly faster, tests didn't show a measurable difference though, at least no regression:
Swapin 4G zero page on ZRAM (time in us):
Before (avg. 1923756)
1912391 1927023 1927957 1916527 1918263 1914284 1934753 1940813 1921791 After (avg. 1922290):
1919101 1925743 1916810 1917007 1923930 1935152 1917403 1923549 1921913
---
include/linux/swap_slots.h | 3 - mm/swap_slots.c | 78 +++--------------------------- mm/swapfile.c | 89 +++++++++++++---------------------- 3 files changed, 44 insertions(+), 126 deletions(-)
include/linux/swap_slots.h renamed from include/linux/swap_slots.h~mm-swap_slots-remove-slot-cache-for-freeing-path +0 -3
@@ -16,15 +16,12 @@ struct swap_slots_cache {swp_entry_t *slots;int nr;int cur; -spinlock_t free_lock;/* protects slots_ret, n_ret */ -swp_entry_t *slots_ret;int n_ret; };void disable_swap_slots_cache_lock (void );void reenable_swap_slots_cache_unlock (void );void enable_swap_slots_cache (void ); -void free_swap_slot (swp_entry_t entry);extern bool swap_slot_cache_enabled;
mm/swapfile.c renamed from mm/swapfile.c~mm-swap_slots-remove-slot-cache-for-freeing-path +34 -55
170 lines not on this page · raw message
mm/swap_slots.c renamed from mm/swap_slots.c~mm-swap_slots-remove-slot-cache-for-freeing-path +10 -68
160 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are