Re: Path forward for Virtualized Swap?

From: Chris Li

Date: Wed Sep 23 2026 - 03:04:38 EST


On Tue, Sep 22, 2026 at 5:49 AM Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
> On Tue, 2026-09-22 at 05:23 -1000, Chris Li wrote:
> >
> > > > > > > Zswap: 8812236 kB
> > > > > > > Zswapped: 24927876 kB
> >
>
> > My original request was for the whole system: what percentage of the
> > total system RAM size has been swapped out to zswap.
> >
> 24.9 GB out of 64 GB is 28%
>
> That is how much application memory was swapped out to zswap.
>
> 12% is how much system memory is used by zswap.
>
> Those are two very different things, and it really is not
> clear to me which of the two you are talking about at what
> point in time.

Let me clarify: I want the ratio of memory swapped out to zswap
(before compression) compared to the total system memory.
Give me the max of your fleet is fine. I have been asking this number
for your usage case for over 6 different email now.

>
> > My observation is that, even with zswap, when 100% of
> > system RAM is swapped out, the application suffers greatly. There is
> > a
> > reason why we only have 7-10% system RAM swapped out.
>
> You mean for your specific workload, you do not
> want more than 5-8 GB out of 64GB to be swapped
> out?
>
> That is perfectly acceptable. You should be able
> to configure that.
>
> However, your configuration values are not a good
> default for my setup.
>
> I believe we need to set the default to something
> that accommodates a diverse range of desktop and
> mobile users.

Act. That is why I am asking for the maximum percentage that
represents the upper bound for an actual usage case.

>
> Most of those users do not know what they will need,
> but they will know to close a few browser tabs when
> things get slow.

They don't need to know. Such a bound exists naturally. We just want a
safe margin. You say such a boundary doesn't exist. I say that
boundary exists; that is the main contention.


> The companies running thousands of servers that
> are carefully managed, and which overwhelmingly
> have the same configuration values deployed to
> them are more than capable of setting the dozen
> or so config values their entire fleet might
> need.

I agree; I wouldn't want to configure each machine differently all the
time. In my mind, swapping out that much system RAM to zswap already
results in a very unusable system. If you haven't try that, I suggest
you try it before suggesting a number > 100%. At 100%, it is not a
usable system, so we don't need to make a default for that. Defaulting
to 8PB or 8TB is way too much.

Chris

>
> --
> All Rights Reversed.