Re: [RFC PATCH v3 7/8] mm/zswap: compressed ram direct integration
From: Gregory Price
Date: Fri Jan 09 2026 - 12:03:51 EST
On Fri, Jan 09, 2026 at 04:00:00PM +0000, Yosry Ahmed wrote:
> On Thu, Jan 08, 2026 at 03:37:54PM -0500, Gregory Price wrote:
> > If a private zswap-node is available, skip the entire software
> > compression process and memcpy directly to a compressed memory
> > folio, and store the newly allocated compressed memory page as
> > the zswap entry->handle.
> >
> > On decompress we do the opposite: copy directly from the stored
> > page to the destination, and free the compressed memory page.
> >
> > The driver callback is responsible for preventing run-away
> > compression ratio failures by checking that the allocated page is
> > safe to use (i.e. a compression ratio limit hasn't been crossed).
> >
> > Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
>
> Hi Gregory,
>
> Thanks for sending this, I have a lot of questions/comments below, but
> from a high-level I am trying to understand the benefit of using a
> compressed node for zswap rather than as a second tier.
>
Don't think to hard about it - this is a stepping stone until we figure
out the cram.c usage pattern.
unrestricted write access to compress-ram a reliability issue, so:
- zswap restricts both read and write.
- a cram.c service would restrict write but leave pages mapped read
Have to step away, will come back to the rest of feedback a bit latter,
thank you for the review.
~Gregory