From: "Lian Wang (ProcessMission)" <lianux.mm@gmail.com>
To: Youngjun Park <youngjun.park@lge.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Chris Li <chrisl@kernel.org>, Nhat Pham <nphamcs@gmail.com>,
Baoquan He <baoquan.he@linux.dev>, Barry Song <baohua@kernel.org>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Kairui Song <kasong@tencent.com>, Jihan LIN <linjh22s@gmail.com>,
Kunwu Chan <kunwu.chan@linux.dev>, Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
linux-hardening@vger.kernel.org
Subject: Re: [RESEND RFC PATCH v2 00/13] mm/swap: introduce per-priority allocation queues
Date: Fri, 4 Sep 2026 18:08:49 +0800 [thread overview]
Message-ID: <20260904100900.21517-1-lianux.mm@gmail.com> (raw)
In-Reply-To: <appvhlPleahTRklV@yjaykim-PowerEdge-T330>
On Fri, 4 Sep 2026 16:13:10 +0900 Youngjun Park <youngjun.park@lge.com> 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
next prev parent reply other threads:[~2026-09-04 10:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 7:43 Lian Wang (ProcessMission)
2026-08-29 7:46 ` [RESEND RFC PATCH v2 01/13] mm/swap: remove unused parameter for reading swap header Lian Wang (ProcessMission)
2026-08-29 7:46 ` [RESEND RFC PATCH v2 02/13] mm/swap: slightly cleanup the code for hibernation error handling Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 03/13] mm/swap: cleanup and document swap device availability flag usage Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 04/13] mm/swap: introduce swap device iteration helper Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 05/13] mm/swap: change the swapon lock into a percpu rwsem Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 06/13] mm/swap: remove swapon mutex and update proc reader Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 07/13] mm/swap: consolidate swap inuse accounting helpers Lian Wang (ProcessMission)
2026-08-29 7:47 ` [RESEND RFC PATCH v2 08/13] mm/swap: change back to use each swap device's percpu cluster Lian Wang (ProcessMission)
2026-08-29 7:48 ` [RESEND RFC PATCH v2 09/13] mm/swap: add priority queue for swap device allocation Lian Wang (ProcessMission)
2026-08-29 7:48 ` [RESEND RFC PATCH v2 10/13] mm/swap: remove available list Lian Wang (ProcessMission)
2026-08-29 7:48 ` [RESEND RFC PATCH v2 11/13] mm/swap: bound synchronous discard during allocation Lian Wang (ProcessMission)
2026-08-29 7:48 ` [RESEND RFC PATCH v2 12/13] mm/swap: drop swap active plist Lian Wang (ProcessMission)
2026-08-29 7:48 ` [RESEND RFC PATCH v2 13/13] lib/plist.c: remove requeue function Lian Wang (ProcessMission)
2026-09-01 15:01 ` [RESEND RFC PATCH v2 00/13] mm/swap: introduce per-priority allocation queues Kunwu Chan
2026-09-04 7:13 ` Youngjun Park
2026-09-04 10:08 ` Lian Wang (ProcessMission) [this message]
2026-09-04 13:02 ` Kairui Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904100900.21517-1-lianux.mm@gmail.com \
--to=lianux.mm@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chrisl@kernel.org \
--cc=gustavoars@kernel.org \
--cc=kasong@tencent.com \
--cc=kees@kernel.org \
--cc=kunwu.chan@linux.dev \
--cc=linjh22s@gmail.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=shikemeng@huaweicloud.com \
--cc=tglx@kernel.org \
--cc=youngjun.park@lge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®