Re: Virtual Swap Sync

From: Kairui Song

Date: Sun Nov 29 2026 - 12:25:54 EST


On Fri, Nov 27, 2026 at 1:30 AM Nhat Pham <nphamcs@xxxxxxxxx> wrote:
>
> On Wed, Nov 25, 2026 at 11:03 PM Baoquan He <baoquan.he@xxxxxxxxx> wrote:
> >
> > On 11/22/26 at 08:31am, Nhat Pham wrote:
> > > - Orthogonal use cases and concerns:
> > > - Cgroup-level logical memory limits in cgroupv2 (memsw?) - swap
> > > developers will follow up with memcg maintainers.
> > > - Static sizing: Define the host-sizing formula and decide whether
> > > another interface is needed.
> > > - Swap tiering for cgroups: Explore backend selection when a
> > > concrete workload needs it.
> >
> > Youngjun's swap tier comes from concrete use case of his company, it's
> > been v11, he presented this in LSF and LPC.
> >
> > [RFC PATCH v11 0/4] mm/swap: priority-based swap tiers with per-cgroup selection
> > https://lore.kernel.org/all/20260916183437.2946306-1-youngjun.park@xxxxxxx/T/#u
> >
> > This is xswap road map I shared with you when we discussed about working
> > together. I also mentioned swap tier in road map because Swap tier is a
> > very important feature we swap developers plan to add.
> >
> > https://lore.kernel.org/all/al8ohWshSSZ64AtT@MiWiFi-R3L-srv/
> >
> > I thought you had read them.
>
> I put this as "orthogonal" because I don't think swap tiering should
> block virtual swap development. It's probably the other way around -
> swap tiering makes a lot less sense without a virtual swap layer.
>
> If you want my opinions on swap tiering, you could search on lore :)
>
> https://lore.kernel.org/linux-mm/CAKEwX=O-_OZ8x0UC96a_k+0eZfAE+mWMWDdn68uy1LHRq=JC0w@xxxxxxxxxxxxxx/
> https://lore.kernel.org/linux-mm/CAKEwX=N2XcMHN1jatppOk6wnmz-Shab5XMtTtzgYOzRvU_6YFw@xxxxxxxxxxxxxx/
> https://lore.kernel.org/all/CAKEwX=NfSy0XiD_UMsDOHGCwpE7sYmBmhV4Y9vk_cbnnr6J6PQ@xxxxxxxxxxxxxx/
> https://lore.kernel.org/all/CAKEwX=NfSy0XiD_UMsDOHGCwpE7sYmBmhV4Y9vk_cbnnr6J6PQ@xxxxxxxxxxxxxx/
>
> I did review Youngjun's code, pointing out some deficiencies we needed
> to fix eventually, but I did not nack anything.
>
> The problem with that series is that the memcg maintainers are not
> satisfied with the proposed interface, and the lack of writeback
> support (i.e data transfer between tier).
>
> I also raised a similar concern in one of those comments. And it's not
> just a nice-to-have either. We can get into LRU inversion scenario
> because of it.
>
> FWIW, virtual swap IS a step to resolve that problem. It provides an
> indirection layer that allow you to change the backend without having
> to do PT walk to update the backend, or repeating the logic at every
> backend level. The "V" in VFS, so to speak.
>
> Similar with the other items on the list - memsw for e.g. I made a
> best effort attempt at least to make vswap work with memsw, but memsw
> in cgroupv2 is its own conversation.
>
> >
> > I don't know why I couldn't join meeting last time, I tried at 8:05am at
> > my side, kept waiting for people to approve me until 8:30am I was
> > added. Not sure if you guys also talked about this.
>
> Hmm maybe I missed that notifications? Apologies if that's the case -
> I do remember letting you in but I wasn't sure at which time. But you
> were eventually in right? I remember you commenting on some
> overcommiting stuff.

TBH It's unfortunate that Baoquan missed about half of the meeting :(
, a lot of shared context was lost there. We can have another sync to
get everyone back on the same page.

On the tiering topic, we've recently seen an increasing growing demand
for swap tiering, due to LLM sandboxes. This is fairly new to me too,
I mean the underlying tech stack itself is nothing new, but the
requirements are quite different, and tiering fits really well there.

I do hope we can collaborate better on this.