[RFC PATCH 0/4] zsmalloc: replace shrinker with deferred compaction
From: Sergey Senozhatsky
Date: Thu Dec 03 2026 - 05:14:24 EST
This is a follow-up to Chris's shrinker removal patch [1] and Barry's
Pixel 6 fragmentation numbers [2].
Removing the shrinker avoids mid-swap compaction stalls, but without
any automatic compaction we risk regressing memory footprint on systems
that do not run a userspace compaction daemon, and on systems that do
proactive swap-out without hitting memory pressure (no shrinker
triggers).
Replace shrinker callbacks (now removed) with deferred threshold-based
compaction in zsmalloc (plus a runtime-tunable zram sysfs knob to
configure or disable it).
Link: https://lore.kernel.org/linux-kernel/18ed2967f99a2eff.3137322e32332e3235332e313736.2c2157.0000sendgmr@xxxxxxxxxx [1]
Link: https://lore.kernel.org/linux-kernel/CAGsJ_4yoogQHpxGigawTfMPEKL_A6OkfEfsmJHzDHLPS3FCUQg@xxxxxxxxxxxxxx [2]
Chris Wiseman (1):
mm/zsmalloc: remove shrinker
Sergey Senozhatsky (3):
zsmalloc: introduce lockless zs_class_can_compact()
zsmalloc: add deferred threshold compaction
zram: add compact_threshold sysfs attribute
Documentation/ABI/testing/sysfs-block-zram | 9 ++
Documentation/admin-guide/blockdev/zram.rst | 2 +
drivers/block/zram/zram_drv.c | 45 +++++++
drivers/block/zram/zram_drv.h | 1 +
include/linux/zsmalloc.h | 3 +
mm/zsmalloc.c | 136 ++++++++++++--------
6 files changed, 142 insertions(+), 54 deletions(-)
--
2.56.1.987.g2ec0ab4260-goog