Re: Path forward for Virtualized Swap?

From: Johannes Weiner

Date: Fri Sep 25 2026 - 17:54:33 EST


On Fri, Sep 25, 2026 at 05:30:03PM -0400, Gregory Price wrote:
> On Sat, Sep 26, 2026 at 04:44:07AM +0800, Kairui Song wrote:
> > On Fri, Sep 25, 2026 at 12:11:55PM +0800, Gregory Price wrote:
> > > That shows up as stalls and PSI pretty quickly and can be dealt with
> > > by monitoring - but I can see the desire to just have them OOM.
> >
> > Right, monitoring is less effective from somehting that is directly
> > in the kernel.
> >
>
> Well.... I think this is probably an organizational philosophy.
>
> We are pretty solidly effective with PSI + proactive reclaim keeping
> our machines chugging along nicely. I think this is where a lot of
> confusion is coming from - because the PSI data is very effective.

There is also that we usually don't add convenience things to the
kernel for what can (easily) be accomplished in userspace.

The job of cgroup is to contain and isolate workloads from each
other. But you're not hurting anybody else by overshooting into
compression. It's a lateral move within memory.max.

> > > > The second one is a policy change,
> > >
> > > Disagree.
> > >
> > > If zswap does not charge a physical slot, then it is correct to stop
> > > charging the counter based on the historic definition - it just was
> >
> > Hmm, but the historical defination is the logical entry, no?
> >
>
> I think this is the entire debate, right?
>
> Historically I think it's clear that it is a physical slot, from the
> time it was proposed it was talked about in terms of consumption, and
> Johannes' original definition even said "physical" (for some reason
> this did not make it into the docs).

Yes, it's physical. Cgroups partition physical resources.

That's the whole reason WHY cgroup2 doesn't have memsw to begin
with. It's not a resource. CPU cycles is a resource. RAM is a
resource. A swap partition is a resource. A NUMA node is a resource.

"Unique page table entries" is not. That's a metric or a constraint
that you might find interesting for your workload. But it doesn't have
anything to do with partitioning a computer into containers.