All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: YoungJun Park <youngjun.park@lge.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, chrisl@kernel.org,
	kasong@tencent.com, baohua@kernel.org, shikemeng@huaweicloud.com,
	nphamcs@gmail.com
Subject: Re: [PATCH] mm/swapfile.c: select the swap device with default priority round robin
Date: Thu, 25 Sep 2025 08:24:40 +0800	[thread overview]
Message-ID: <aNSLyF9euWstYpYu@MiWiFi-R3L-srv> (raw)
In-Reply-To: <aNQdpCgC6PDLegr5@yjaykim-PowerEdge-T330>

On 09/25/25 at 01:34am, YoungJun Park wrote:
> On Wed, Sep 24, 2025 at 05:17:46PM +0800, Baoquan He wrote:
> > -	int i;
> > -
> > -	if (prio >= 0)
> > -		si->prio = prio;
> > -	else
> > -		si->prio = --least_priority;
> > +	si->prio = prio;
> 
> 
> > -     if (p->prio < 0) {
> > -             struct swap_info_struct *si = p;
> > -             int nid;
> > -
> > -             plist_for_each_entry_continue(si, &swap_active_head, list) {
> > -                     si->prio++;
> > -                     si->list.prio--;
> > -                     for_each_node(nid) {
> > -                             if (si->avail_lists[nid].prio != 1)
> > -                                     si->avail_lists[nid].prio--;
> > -                     }
> > -             }
> > -             least_priority++;
> > -     }
>  
> Hi Baoquan He,
> 
> I noticed that in `_enable_swap_info()` there is still a comment describing
> the behavior that this patch removes(auto assigning priority). 
> Shouldn’t that part also be updated accordingly?

You are right, this need be updated. Will change in v2. Thanks a lot for
careful reviewing.

> 
> static void _enable_swap_info(struct swap_info_struct *si)
> {
>         ...
>         /*
>          * both lists are plists, and thus priority ordered.
>          * swap_active_head needs to be priority ordered for swapoff(),
>          * which on removal of any swap_info_struct with an auto-assigned
>          * (i.e. negative) priority increments the auto-assigned priority
>          * of any lower-priority swap_info_structs.
>          * swap_avail_head needs to be priority ordered for folio_alloc_swap(),
>          * which allocates swap pages from the highest available priority
>          * swap_info_struct.
>          */
> 
> Best regards,
> Youngjun Park
> 



  reply	other threads:[~2025-09-25  0:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  9:17 [PATCH] mm/swapfile.c: select the swap device with default priority round robin 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
2025-09-28  2:14           ` Baoquan He
2025-09-24 16:34 ` YoungJun Park
2025-09-25  0:24   ` Baoquan He [this message]
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=aNSLyF9euWstYpYu@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=chrisl@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.