Re: Path forward for Virtualized Swap?
From: Rik van Riel
Date: Mon Sep 21 2026 - 11:40:06 EST
On Mon, 2026-09-21 at 09:27 -0400, Gregory Price wrote:
>
> In short:
>
> memory.swap = logical swap - workload/SLO limit
> memory.pswap = physical swap - storage limit
> memory.zswap = compressed memory - RAM limit
>
> This would preserve the existing memory.swap semantics while allowing
> both backing resources to be constrained independently.
>
My first thought was "this is confusing", but
after a minute I realized that most users will
never set those options to anything other than
"0" or "max", and the few who do only need to
touch one of them.
Some people may want to limit a particular
workload to having no more than 8 GB in a
place that is not directly accessible.
They would set memory.swap = 8G
Other people may want to limit how much
memory is used for the zswap pool.
They use memory.zswap.
Yet other people may want to limit how much
physical swap space is used for a particular
cgroup. They use memory.pswap.
Almost nobody would use all three.
Which one you use depends on your use case.
--
All Rights Reversed.