public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/2] mm/swapfile: fix list iteration when next node is removed during discard
       [not found] ` <20260220151338.3234934-1-clm@meta.com>
@ 2026-02-22  1:41   ` YoungJun Park
  2026-02-22 19:36     ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: YoungJun Park @ 2026-02-22  1:41 UTC (permalink / raw)
  To: Chris Mason
  Cc: akpm, stable, chrisl, kasong, shikemeng, nphamcs, bhe, baohua,
	linux-mm, stable

On Fri, Feb 20, 2026 at 07:13:33AM -0800, Chris Mason wrote:
> On Thu, 27 Nov 2025 19:03:02 +0900 Youngjun Park <youngjun.park@lge.com> wrote:
> 
> > When the next node is removed from the plist (e.g. by swapoff),
> > plist_del() makes the node point to itself, causing the iteration to
> > loop on the same entry indefinitely.
> > 
> > Add a plist_node_empty() check to detect this case and restart
> > iteration, allowing swap_sync_discard() to continue processing
> > remaining swap devices that still have pending discard entries.
> > 
> > Additionally, switch from swap_avail_lock/swap_avail_head to
> > swap_lock/swap_active_head so that iteration is only affected by
> > swapoff operations rather than frequent availability changes,
> > reducing exceptional condition checks and lock contention.
> > 
> > Fixes: 686ea517f471 ("mm, swap: do not perform synchronous discard during allocation")
> > Suggested-by: Kairui Song <kasong@tencent.com>
> > Acked-by: Kairui Song <kasong@tencent.com>
> > Signed-off-by: Youngjun Park <youngjun.park@lge.com>
> >
> 
> Hi everyone,
> 
> This fix landed upstream in v6.19-rc1:
> 
> commit f9e82f99b3771eef396dbf97e0f3c76e20af60dd
> Author: Youngjun Park <youngjun.park@lge.com>
> Date:   Thu Nov 27 19:03:02 2025 +0900
> Subject: mm/swapfile: fix list iteration when next node is removed during discard
> 
> Looks like the commit being fixed is actually:
> 
> commit 9fb749cd15078c7bdc46e5d45c37493f83323e33
> Author: Kairui Song <kasong@tencent.com>
> Date:   Fri Oct 24 02:34:11 2025 +0800
> Subject: mm, swap: do not perform synchronous discard during allocation
> 
> v6.18.y stable has Kairui Song's commit, but this fix hasn't made it to stable.
> Johannes noticed the Fixes: tag doesn't match, which probably explains
> the gap, but I think we should pull this fix (f9e82f99b) in.

+Cc: stable@vger.kernel.org
Thanks for catching this and pushing for the stable backport.

Acked-by: Youngjun Park youngjun.park@lge.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/2] mm/swapfile: fix list iteration when next node is removed during discard
  2026-02-22  1:41   ` [PATCH v2 1/2] mm/swapfile: fix list iteration when next node is removed during discard YoungJun Park
@ 2026-02-22 19:36     ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2026-02-22 19:36 UTC (permalink / raw)
  To: YoungJun Park
  Cc: Chris Mason, stable, chrisl, kasong, shikemeng, nphamcs, bhe,
	baohua, linux-mm, stable

On Sun, 22 Feb 2026 10:41:50 +0900 YoungJun Park <youngjun.park@lge.com> wrote:

> > Hi everyone,
> > 
> > This fix landed upstream in v6.19-rc1:
> > 
> > commit f9e82f99b3771eef396dbf97e0f3c76e20af60dd
>
> > Author: Youngjun Park <youngjun.park@lge.com>
> > Date:   Thu Nov 27 19:03:02 2025 +0900
> > Subject: mm/swapfile: fix list iteration when next node is removed during discard
> > 
> > Looks like the commit being fixed is actually:
> > 
> > commit 9fb749cd15078c7bdc46e5d45c37493f83323e33

yup.  I've updated the changelog.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-22 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251127100303.783198-2-youngjun.park@lge.com>
     [not found] ` <20260220151338.3234934-1-clm@meta.com>
2026-02-22  1:41   ` [PATCH v2 1/2] mm/swapfile: fix list iteration when next node is removed during discard YoungJun Park
2026-02-22 19:36     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox