Re: Path forward for Virtualized Swap?
From: Rik van Riel
Date: Sun Sep 27 2026 - 08:31:13 EST
On Sat, 2026-09-26 at 20:23 -1000, Chris Li wrote:
> On Sat, Sep 26, 2026 at 2:59 PM Rik van Riel <riel@xxxxxxxxxxx>
> wrote:
>
>
> > The fair resource use from memory.swap.max
> > is to control how much of the fixed swap file
> > (or swap partition) space each cgroup gets.
>
> That is the part I am not sure I understand correctly. Fair in what
> sense? Using the swap file proportional to the memory limit of the
> cgroup? Do you have an example of perfectly fair swap file usage for
> a
> cgroup with an 8G memory limit versus one with a 1G limit?
>
> Sorry I am a bit slow grasping what exactly the fair behavior is.
Say we have a 64GB swap file, and several
cgroups on the system, applications A & B,
and system.slice.
We might give system.slice a 10GB memory.swap.max,
and each application a 25GB memory.swap.max.
This way a memory leak in application B
does not result in application A being
unable to run.
The thing that leaks (if anything) ends up
getting killed, not the innocent bystander.
--
All Rights Reversed.