Re: [PATCH] mm/zsmalloc: remove shrinker

From: Chris Wiseman

Date: Wed Dec 02 2026 - 23:43:00 EST


Hi Sergey, Barry, Nanzhe, Andrew,

Barry, Nanzhe, thanks for the Pixel 6 numbers. 32 MB to 182 MB median
(622 MB peak) is a real regression, so the shrinker removal shouldn't go
in alone.

Sergey, moving compaction to a background worker gated on
zs_pool_can_compact() looks good to me. Three quick things on the
sketch:

1. Can we make compact_threshold writable after init (like mem_limit)
instead of returning -EBUSY? Android needs to tune it live without
resetting zram. That'll just need WRITE_ONCE() in the store and
READ_ONCE() in zram_schedule_compaction(), since slot_free() doesn't
hold dev_lock.

2. If it defaults to 0, removing the shrinker regresses anyone who
doesn't know the knob exists. We should pick a non-zero default from
data rather than guessing. Barry, Nanzhe, could you test 5 and 10 on
that same Pixel 6 loop?

3. The 10-second timer doesn't know about memory pressure, whereas the
shrinker ran when reclaim wanted pages. Not a blocker, just the first
thing I'd watch if the Pixel numbers don't come back down.

Andrew, please drop mm-zsmalloc-remove-shrinker.patch from mm-new for
now. Once we have the Pixel 6 numbers, we can send a 2-patch series
with Sergey's patch first and the shrinker removal second so git bisect
doesn't hit a regressing commit. Sergey, happy to carry your patch or
rebase mine on top of yours, whichever you prefer.

Thanks,
Chris