Re: [RFC PATCH v11 0/4] mm/swap: priority-based swap tiers with per-cgroup selection
From: Lian Wang
Date: Fri Sep 25 2026 - 02:55:54 EST
On Wed, Sep 23, 2026 at 01:15:14PM -0400, Johannes Weiner wrote:
> If you can think of a good usecase, memory.swap.prio.min would be
> certainly a natural extension. But we should get the usecase laid out.
>
> The requirement to punch holes is the one I can relate to least. Why
> would a cgroup need access to good tiers and bad tiers, but skip the
> middle ones?
>
> This would seem less like tiering/hierarchy and more like flat
> per-cgroup swap pools but with obstacles.
Hi Johannes and Youngjun,
Sorry that I am only joining this part of the discussion now.
I recently started helping carry Kairui's swap queue work forward. Our
current v2 is here [1]. Youngjun's tier work interacts directly with it:
v2 maintains a device queue and reader for each priority, while v11 makes
each priority a tier and moves device selection under that tier.
I did a functional integration test of v11 on an x86-64 host. The tier
mask, fallback, same-priority device allocation, concurrent allocation,
and swapoff smoke tests all worked without kernel warnings. This was a
zram integration test, not yet a real multi-SSD performance test.
One result seems relevant to this discussion: with a restricted parent
and an unconfigured child, the child could still use the faster tier. I
therefore agree that an inheritable memory.swap.prio.max looks like the
cleaner first cgroup interface. A hole in the mask worked mechanically,
but I do not yet have a convincing hierarchical use case for it; it felt
more like per-cgroup swap-pool membership.
For the queue integration, one possible boundary is for the tier to own
the queue/reader and for the swap queue to become the default per-tier
device allocation policy. I would like to align this with both of you
before changing v2. I will also continue the real multi-SSD tests.
If either of you has suggestions or specific test cases you would like
to see, please let me know. I have a few test setups available and should
be able to try some of them. I am still getting up to speed on this part
of MM, so please correct me if I missed some context or got any detail
wrong.
[1] https://lore.kernel.org/all/20260829-swap-pcp-priq-v2-resend-0-68d3d925578c@xxxxxxxxx/
Thanks,
Lian