Re: [PATCH v10 0/6] mm/swap, memcg: Introduce swap tiers for cgroup based swap control

From: Johannes Weiner

Date: Thu Jul 23 2026 - 10:40:25 EST


Hello Youngjun,

On Thu, Jul 23, 2026 at 08:39:22PM +0900, Youngjun Park wrote:
> On Wed, Jul 22, 2026 at 09:14:10AM -0400, Johannes Weiner wrote:
>
> Hello Johannes!
>
> > Zswap is a first-order swap destination with writeback semantics. The
> > way the discussion around zswap has been going in this thread is
> > disappointing, and I don't feel comfortable adding permanent user
> > interfaces on this basis.
>
> I have given this a lot of thought. First, could you clarify exactly which
> part of the discussion or consensus makes you hesitate? Understanding this
> will help me re-evaluate my proposal.
>
> To make sure we are on the same page, I would like to share my thoughts and
> vision for the present and future of the tier interface semantics for your
> further consideration.
>
> The interface should provide the swap amount allocated to a tier and allow
> the use of the swap device defined by that tier via swap.tiers.max.
> Currently, it would only support 0 and 'max' (essentially on/off for
> explicit usage). Auto-demotion is planned for the future, and specifying
> exact capacity limits is still to be determined. (I have also reviewed
> potential interface collisions and duplications based on Yosry's guidance.)

This is the part that makes me uncomfortable. The interface as
proposed now is just a small subset of what should eventually be "swap
tiers" - with limits, hierarchies and demotion rules. It seems to be
an unordered blacklist/whitelist for swapfiles right now.

And how the final form looks like depends on the indirection layer.

As Chris says upthread, virtual swap will be a whole new world. But
unfortunately interfaces are permanent. So I'm sorry, but it's
premature to start tying us to an ABI direction here.

> > We will not be merging a memcg swap tier interface until the swap side
> > has a story for indirection and backend migration.
>
> Regarding this point, is your position that an indirect layer (I see
> this is virtualized swap) must be implemented first?

It is implemented. There have been patches floating around since the
beginning of 2025. Initial proposals date back to 2023.

But we need settled consensus before we can start adding interfaces
that are supposed to control that very layer long-term.