linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: YoungJun Park <youngjun.park@lge.com>
To: Baoquan He <bhe@redhat.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 01:34:44 +0900	[thread overview]
Message-ID: <aNQdpCgC6PDLegr5@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <20250924091746.146461-1-bhe@redhat.com>

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?

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


  parent reply	other threads:[~2025-09-24 16:35 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
2025-09-28  2:14           ` Baoquan He
2025-09-24 16:34 ` YoungJun Park [this message]
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=aNQdpCgC6PDLegr5@yjaykim-PowerEdge-T330 \
    --to=youngjun.park@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=kasong@tencent.com \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=shikemeng@huaweicloud.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