On Fri, 4 Sep 2026 16:13:10 +0900 Youngjun Park <[email protected]> wrote:

> Since tiers come up further down, I'd like to raise a point about the
> patch subject line too. As Kairui mentioned in RFC v1 that we would
> stay aligned with tiers, would it make sense to frame this RFC as a
> per-tier allocation policy (or something along those lines)? Kairui,
> what's your opinion?

Thanks for the thoughtful feedback and for taking an initial pass over
the series.

I agree that this queue could naturally become an in-tier allocation
policy. For this RFC, I would prefer to keep it separate and scoped to
the existing priority semantics while the tier and virtual-swap
directions are still being settled. We can revisit the subject and
naming once that boundary is clearer.

I will also sync with Kairui when he has time. He has several things in
flight, but his view on the ownership and framing would be valuable.

> Devices assigned to the same tier already share the same priority, so
> I don't think the allocation policy needs more than one option for
> that case (I can't think of a use case that would need it).
>
> 1. For legacy swap with no tier configured, define it as a single
>    priority treated as one tier.
> 2. When priorities match, allocation naturally falls to a single
>    policy (not a queue). the concrete policy here is this
>    queue-based scheme.
> 3. When tiers are enabled, devices previously assigned under legacy
>    swap are reassigned to tiers at runtime.
>    (This means different swap device on same tier handled like same priority 
> device)

These are useful design points. I would like to study the concrete v11
before deciding between runtime, boot-time, or compile-time tier
assignment. It seems safer not to bind this queue RFC to a permanent
tier interface while those semantics and the virtual-swap backend model
are still under discussion.

> I think this feature will also be needed on the virtualized swap side,
> which makes me wonder whether this patch should go back into the swap
> tier series instead. Kairui, Lian, what do you think? (Or separately?)
>
> I've also been thinking about how to move the tier series forward
> since v10. I'll prepare v11 shortly.

I agree that the mechanism should be useful on the virtualized-swap side
too. Once you post v11, I will study and review it, and I am happy to
work with you on whether the queue should be rebased onto the tier
infrastructure or remain a separate policy layer.

> This is the direction I was hoping for. (TBD)
>
> Within a tier. /sys/kernel/mm/swap/tiers/<tier name>/<policy name>
>
> - Across tiers: allocation follows priority based on speed
>   differences.
> - Within a tier: a selectable policy applies.
>   - The default policy is this series' scheme.
>   - Priority-based distribution should also be possible within a
>     tier.
>   - If xswap is introduced, its allocation should be selectable based
>     on memcg.
>   - Other custom allocation methods (round-robin, etc.).

The split between cross-tier selection and an in-tier allocation policy
makes sense to me. Keeping the current queue as an independent mechanism
for now should let us evaluate it as the possible default policy without
committing the tier ABI prematurely.

> No regression is great news. the plist refactor is valuable on its
> own merits.
>
> That said, could you also share data on other angles, such as lock-
> contention benefits, or advantages in other use-case scenarios? (I'll
> also think about what would be worth testing here.)

Yes. I will add direct lock-contention measurements, the one-device
case, and higher-priority rings containing full devices. Let's keep
sharing results and test ideas as the two series evolve.

> I've done an initial pass and given my review. I'll keep providing
> feedback as I go through the patch contents. :)

Thank you. The v2 code delta from v1 is intentionally focused. If you
find any problem in the individual patches, please let me know and I
will iterate on it with you. I also plan to spend time this weekend
studying your recent v3 swap work, and I look forward to reviewing v11.

Thanks,
Lian

Reply via email to