From: Chris Li <chrisl@kernel.org>
To: Baoquan He <bhe@redhat.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
kasong@tencent.com, baohua@kernel.org,
shikemeng@huaweicloud.com, nphamcs@gmail.com,
YoungJun Park <youngjun.park@lge.com>
Subject: Re: [PATCH] mm/swapfile.c: select the swap device with default priority round robin
Date: Fri, 26 Sep 2025 21:46:04 -0700 [thread overview]
Message-ID: <CACePvbUusk1D_=bTuzB_brDNgpgmbbKUxr1fXD-EExGp=A_=dw@mail.gmail.com> (raw)
In-Reply-To: <aNaxvEiMgh+EqGjt@fedora>
On Fri, Sep 26, 2025 at 8:31 AM Baoquan He <bhe@redhat.com> wrote:
> On 09/25/25 at 11:25am, Chris Li wrote:
> > Just curious, is setting to "-1" matches to kernel behavior before
> > a2468cc9bfdf, if not what is the behavior before a2468cc9bfdf.
>
> It should be like below. It's not a real output, I made the data to show
> what it looks like.
>
> # swapon
> NAME TYPE SIZE USED PRIO
> /dev/zram0 partition 16G 15.8G -1
> /dev/zram1 partition 16G 0B -2
> /dev/zram2 partition 16G 0B -3
> /dev/zram3 partition 16G 0B -4
>
> I just apply this patch and set the priority to emulate the kerel
> behavirour before a2468cc9bfdf. In kernel before a2468cc9bfdf, it sets
> priority to swap device from -1 downwards. There's only one
> swap_avail_head plist for all CPUs. The behaviour is very much like below:
>
> [root@hp-dl385g10-03 ~]# swapon
> NAME TYPE SIZE USED PRIO
> /dev/zram0 partition 16G 0B 0
> /dev/zram1 partition 16G 0B 1
> /dev/zram2 partition 16G 0B 2
> /dev/zram3 partition 16G 14.3G 3
I see, in that case it is not a simple revert. It is revert plus a
change to make the default to use round robin. I suggest you split the
patch into two parts, one is the conceptual clean revert, back to the
pre a2468cc9bfdf without behavior change. Then the second one is
changed to the round robin. That will make your behavior change more
obvious.
I suspect that even pre a2468cc9bfdf, the round robin might outperform
per node priority already. Which means there exists a much simpler
solution all alone. Even though I am curious, I am not demanding the
answer from you. Your test data against the latest kernel, which shows
great performance improvement is good enough. We don't have to test
that really old kernel.
Chris
next prev parent reply other threads:[~2025-09-27 4:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 9:17 Baoquan He
2025-09-24 10:23 ` Baoquan He
2025-09-24 15:41 ` YoungJun Park
2025-09-25 2:24 ` Baoquan He
2025-09-24 15:52 ` YoungJun Park
2025-09-25 4:10 ` Baoquan He
2025-09-25 4:23 ` Baoquan He
2025-09-24 15:54 ` Chris Li
2025-09-24 16:06 ` Chris Li
2025-09-25 2:15 ` Baoquan He
2025-09-25 18:31 ` Chris Li
2025-09-25 1:55 ` Baoquan He
2025-09-25 18:25 ` Chris Li
2025-09-26 15:31 ` Baoquan He
2025-09-27 4:46 ` Chris Li [this message]
2025-09-28 2:14 ` Baoquan He
2025-09-24 16:34 ` YoungJun Park
2025-09-25 0:24 ` Baoquan He
2025-09-25 4:36 ` Kairui Song
2025-09-25 6:18 ` Baoquan He
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='CACePvbUusk1D_=bTuzB_brDNgpgmbbKUxr1fXD-EExGp=A_=dw@mail.gmail.com' \
--to=chrisl@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=shikemeng@huaweicloud.com \
--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