Re: [RFC PATCH v2 0/7] mm, swap: Virtual Swap Space (Swap Table Edition)
From: Nhat Pham
Date: Sun Jun 14 2026 - 22:39:13 EST
On Sun, Jun 14, 2026 at 4:20 AM YoungJun Park <youngjun.park@xxxxxxx> wrote:
>
> ...
> > * Integration with swap.tier by Youngjun (see [12]). For now, I'm
> > leaning towards opting out the vswap device from swap.tier entirely, and
> > treat it as a special device. Integrating it with swap.tiers will
> > benefit the cases where you want some cgroups to skip vswap for fast
> > swap devices (pmem), whereas other should go through zswap first. But
> > most other use cases, either the overhead of vswap will be acceptable
> > (or not the bottleneck), or we can just disable CONFIG_VSWAP entirely :)
> >
> > Youngjun, may I ask for your thoughts on this?
>
> Hi Nhat,
>
> Tier 1: VSWAP, Tier 2: ZSWAP ...
>
> I don't see any problem applying the desired functionality with the
> currently proposed mechanism and interface. With this, a user would be
> assigned the default Virtual -> RAM swap tier, and the overall picture
> becomes one where swap tiers are composed according to the priority
> setting.
It's more - is there a strong argument to let vswap be a tier (which
is not supported by just turning of vswap altogether).
Because right now I'm not exposing vswap device to userspace in any
manner, pretty much. It's abstract and transparent, and minimizes
complexity (no vswap and swap.tier interaction) and surfaces for
issues.
But if you have a strong use case in mind please let me know :)
Worst case scenario if we're wrong, we can always do it as a follow-up
down the line.
>
> A few more thoughts came to mind.
>
> Shakeel also proposed a per-tier max for the swap tier interface.
>
> https://lore.kernel.org/linux-mm/aiw2p5ANjsQUCIHA@xxxxxxxxx/
>
> However, for vswap, rather than treating it as a case for limiting the
> amount via such a per-tier max, I think the current interface is the
> better fit. (But, as Shakeel mentioned, if we only allow the limit
> to be set to 0 or max, the usage could end up being the same. I'm still
> thinking this part through.)
>
> I have a few other thoughts as well, but I plan to raise those points in
> the swap tier discussion thread instead. Please take a look at the
> related thread, and let me know if you have any opinions. :)
I'm following that thread too. I'm still thinking about it - will let
you know when I have a more definitive opinion.