Re: [PATCH 0/3] mm/zram: route block swap I/O through swap_ops

From: Jianyue Wu

Date: Wed Jun 17 2026 - 10:03:52 EST


On Wed, Jun 17, 2026 at 2:17 PM Christoph Hellwig <hch@xxxxxx> wrote:
>
> On Wed, Jun 17, 2026 at 11:38:02AM +0800, Jianyue Wu wrote:
> > Before I rework or drop the RFC, could you outline how you see that
> > core-side model working? In particular:
> > - How should a compressed backend like zram or future block device
> > plug into swap_iocb / swap_ops?
>
> I don't think that is the right layer. The virtual swap layer that is
> currently in the process of being upstreamed is the right level, and
> the actual swap devices or swap files are just a dumb backend for what
> they higher level code does.
>
> > - What role do you expect zram to keep while the legacy block interface
> > remains: current block swap only, or something else?
>
> For now we'll need to keep it working as-is. It is heavily used in
> android and potentially elsewhere. Once we have zswap fully working
> in the virtual swap layer world it might make sense to say never
> compress again in zram when REQ_SWAP is set (or maybe a new
> REQ_COPRESSED) so that we can use the core compression code without
> breaking existing setups.
>
Hello Christoph,

Thanks for the clarification.

I understand the goal is to have more common code in the core layer,
with dumb backends. On the swap path, once core has already compressed
the data, zram would only store it and not compress again, while
non-swap use of zram stays as-is.

Thanks,
Jianyue