linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: YoungJun Park <youngjun.park@lge.com>
To: Kairui Song <ryncsn@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	shikemeng@huaweicloud.com, kasong@tencent.com, nphamcs@gmail.com,
	bhe@redhat.com, baohua@kernel.org, chrisl@kernel.org,
	gunho.lee@lge.com
Subject: Re: [PATCH 4/5] mm: swap: change swap_alloc_slow() to void
Date: Thu, 30 Oct 2025 23:39:49 +0900	[thread overview]
Message-ID: <aQN4taRJX+Yms89U@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <xgj3sxgxcwi6lflt6oy63ifq3b3bcle7l2543oa7aotw3qpm2y@cfqwh54n3737>

On Thu, Oct 30, 2025 at 12:13:20AM +0800, Kairui Song wrote:
> On Wed, Oct 29, 2025 at 05:56:58PM +0800, Youngjun Park wrote:
> > swap_alloc_slow() does not need to return a bool, as all callers
> > handle allocation results via the entry parameter. Update the
> > function signature and remove return statements accordingly.
> > 
> > Signed-off-by: Youngjun Park <youngjun.park@lge.com>
> > ---
> >  mm/swapfile.c | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/mm/swapfile.c b/mm/swapfile.c
> > index b5d42918c01b..89eb57eee7f7 100644
> > --- a/mm/swapfile.c
> > +++ b/mm/swapfile.c
> > @@ -1339,7 +1339,7 @@ static bool swap_alloc_fast(swp_entry_t *entry,
> >  }
> >  
> >  /* Rotate the device and switch to a new cluster */
> > -static bool swap_alloc_slow(swp_entry_t *entry,
> > +static void swap_alloc_slow(swp_entry_t *entry,
> >  			    int order)
> >  {
> >  	unsigned long offset;
> > @@ -1356,10 +1356,10 @@ static bool swap_alloc_slow(swp_entry_t *entry,
> >  			put_swap_device(si);
> >  			if (offset) {
> >  				*entry = swp_entry(si->type, offset);
> > -				return true;
> > +				return;
> >  			}
> >  			if (order)
> > -				return false;
> > +				return;
> >  		}
> >  
> >  		spin_lock(&swap_avail_lock);
> > @@ -1378,7 +1378,6 @@ static bool swap_alloc_slow(swp_entry_t *entry,
> >  			goto start_over;
> >  	}
> >  	spin_unlock(&swap_avail_lock);
> > -	return false;
> >  }
> >  
> 
> Hi Youngjun,
> 
> Thanks for the patch.
> 
> I just found a patch from mine series is doing the same thing:
> https://lore.kernel.org/linux-mm/20251029-swap-table-p2-v1-15-3d43f3b6ec32@tencent.com/
> 
> I'm fine merging your cleanup first, the conflict is really trivial and easy to resolve.
> 
> So:
> 
> Reviewed-by: Kairui Song <kasong@tencent.com>
> 
 
Hello Kairui,

Ah, I see you're working on the same area! Thanks for the review and
for being flexible about the merge order. Much appreciated!

Best,
Youngjun Park


  reply	other threads:[~2025-10-30 14:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29  8:56 [PATCH 0/5] mm: swap: small fixes and comment cleanups Youngjun Park
2025-10-29  8:56 ` [PATCH 1/5] mm, swap: Fix memory leak in setup_clusters() error path Youngjun Park
2025-10-29 15:41   ` Kairui Song
2025-10-30 14:32     ` YoungJun Park
2025-10-29  8:56 ` [PATCH 2/5] mm, swap: Use SWP_SOLIDSTATE to determine if swap is rotational Youngjun Park
2025-10-29 16:09   ` Kairui Song
2025-10-30 14:35     ` YoungJun Park
2025-10-29  8:56 ` [PATCH 3/5] mm, swap: Remove redundant comment for read_swap_cache_async Youngjun Park
2025-10-29  8:56 ` [PATCH 4/5] mm: swap: change swap_alloc_slow() to void Youngjun Park
2025-10-29 16:13   ` Kairui Song
2025-10-30 14:39     ` YoungJun Park [this message]
2025-10-29  8:56 ` [PATCH 5/5] mm: swap: remove scan_swap_map_slots() references from comments Youngjun Park

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=aQN4taRJX+Yms89U@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=gunho.lee@lge.com \
    --cc=kasong@tencent.com \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=ryncsn@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