Re: Path forward for Virtualized Swap?
From: Chris Li
Date: Sun Sep 27 2026 - 19:54:17 EST
On Sun, Sep 27, 2026 at 8:12 AM Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
> The only real change we are looking for is
> that once zswap no longer automatically takes
> up real swap space, the zswap use is no longer
> counted under memory.swap.max
>
> Only the data written out from zswap to
> physical swap would count toward memory.swap.max.
Johannes has a nice write up in this email thread that talks about the
two usage cases:
https://lore.kernel.org/all/araWKyJ5MENBwXCL@xxxxxxxxxxx/
I think what you describe is the usage 2)
I think we need to respect both usage cases. 1) is the established
one, which I'm more familar. Currently, zswap charges to memory.swap.
It is the status quo. Breaking this requires figuring out an
alternative and implementing it in phases.
I recall some proposal has been raise, give the usage case 2) a
different set of counters and limits. e.g. memory.pswap.max. I also
recall there were voices against it, arguing it was too complicated
etc. I haven't fully understood all the details. It would be better if
we don't have to break usage case 1) at all.
Chris
>
> That way both of the fixed size resources are
> counted according to their own limits:
> - memory.swap.max limits physical swap use
> - memory.max limits anon + file + slab + zswap
>
> --
> All Rights Reversed.