Re: Path forward for Virtualized Swap?
From: Chris Li
Date: Sun Sep 27 2026 - 12:17:46 EST
On Sun, Sep 27, 2026 at 2:29 AM Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
> 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.
Thanks for the explanation. To me, this is just standard
memory.swap.max limit behavior. I was thinking there was some new
concept of the fairness I haven't grasp..Thanks for the clarification
anyway.
>
> The thing that leaks (if anything) ends up
> getting killed, not the innocent bystander.
I fully agree that is the behavior some of users want, it is what I
would want as well.
Chris