Re: [RFC PATCH v3 7/8] mm/zswap: compressed ram direct integration

From: Yosry Ahmed

Date: Thu Jan 15 2026 - 17:09:49 EST


On Thu, Jan 15, 2026 at 12:26:41PM -0500, Gregory Price wrote:
> > > For the first go, yeah. A cram.c would need special page table handling
> > > bits that will take a while to get right. We can make use of the
> > > hardware differently in the meantime.
> >
> > Makes sense.
> >
> > I just want to point out that using compressed memory with zswap doesn't
> > buy us much in terms of reclaim latency, so the main goal here is just
> > saving memory on the top tier, not improving performance, right?
> >
>
> Yeah first goal is to just demonstrate such an accelerator can even work
> as a top-tier memory saving mechanism. But hard to say whether reclaim
> latency will be affected appreciably - won't know until we get there :]
>
> I'm totally prepared for this to be a science experiment that gets
> thrown away.

If that's the case I would put the zswap stuff under an experimental
config option that's not enabled by default, so that we can rip it out
later if needed.

>
> > >
> > > I will probably need some help to get the accounting right if I'm being
> > > honest. I can't say I fully understanding the implications here, but
> > > what you describe makes sense.
> > >
> >
> > Yeah it's counter-intuitive. Zswap needs to charge less than PAGE_SIZE
> > so that memcg tracking continues to make sense with reclaim (i.e. usage
> > goes down), but if zswap consumed a full page from the system
> > perspective, the math won't math.
> >
> > Separate limits *could* be the answer, but it's harder to configure and
> > existing configuration won't "just work" with compressed memory.
> >
>
> I think you are right. I am also inquiring whether individual page
> compression data is retrievable. If so, then this actually should be a
> trivial integration.
>
> If not then this is probably ending up on the cutting room floor and
> going straight to a full cram.c implementation.
>
> ~Gregory