Re: [PATCH] mm/zsmalloc: remove shrinker

From: Sergey Senozhatsky

Date: Thu Dec 03 2026 - 22:07:38 EST


On (26/12/03 08:16), Yosry Ahmed wrote:
> > > 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.
> >
> > So that 10 seconds cooldown is there because those slot-free calls don't
> > come alone, usually. It's more likely to be a burst of slot-free's and
> > 10 seconds wait kind of tries to space them (burst and compaction) out.
>
> 10 seconds could be too long or too short, and it can hit another
> slot-free burst. What if we kick the deferred work by a smaller amount
> every time instead of a fixed "10 seconds after first slot-free"?
> Basically, if (let's say) 1 second passes with no slot freeing, then
> the async compaction runs and checks the threshold?

10 seconds static timeout was for simplicity, in current iteration
I'm mirroring (well, at least I think that's what I'm doing)
mm/compaction.c exponential backoff logic.

> Also, does compact_threshold belong in zsmalloc not zram, so that it
> can also be used for zswap? I also wonder if the proactive compaction
> zram interface should be deprecated in favor of just tuning the
> threshold to have a single mechanism for zsmalloc compaction.

Sure, zram compaction was an initial solution, it has moved to zsmalloc
since then.

> > > 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.
> >
> > I think your patch will go in as is, no need to rebase, the remaining
> > work will stack on top of it. I guess we want shrinker replacement,
> > just need to figure out what do we replace it with.
>
> Might be better to put it at the end so that there's no intermittent
> regressions. Not a big deal tho.

Yeah, probably not a big deal.