linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/swap: fix wrong plist empty check in swap_alloc_slow()
@ 2025-11-19 11:41 Youngjun Park
  2025-11-19 13:02 ` Kairui Song
  2025-11-20  2:47 ` Baoquan He
  0 siblings, 2 replies; 9+ messages in thread
From: Youngjun Park @ 2025-11-19 11:41 UTC (permalink / raw)
  To: akpm
  Cc: chrisl, kasong, shikemeng, nphamcs, bhe, baohua, linux-mm, youngjun.park

swap_alloc_slow() was checking `si->avail_list` instead of `next->avail_list`
when verifying if the next swap device is still in the list, which could cause
unnecessary restarts during allocation.

Fixes: 8e689f8ea45ff ("mm/swap: do not choose swap device according to numa node")
Signed-off-by: Youngjun Park <youngjun.park@lge.com>
---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 94e0f0c54168..cf780fefaf7d 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1374,7 +1374,7 @@ static bool swap_alloc_slow(swp_entry_t *entry,
 		 * still in the swap_avail_head list then try it, otherwise
 		 * start over if we have not gotten any slots.
 		 */
-		if (plist_node_empty(&si->avail_list))
+		if (plist_node_empty(&next->avail_list))
 			goto start_over;
 	}
 	spin_unlock(&swap_avail_lock);
-- 
2.34.1



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

end of thread, other threads:[~2025-11-21 16:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-19 11:41 [PATCH] mm/swap: fix wrong plist empty check in swap_alloc_slow() Youngjun Park
2025-11-19 13:02 ` Kairui Song
2025-11-19 16:37   ` YoungJun Park
2025-11-20  2:08     ` Kairui Song
2025-11-20  2:06   ` YoungJun Park
2025-11-20  2:18     ` Kairui Song
2025-11-21  6:54       ` YoungJun Park
2025-11-21 16:56         ` Kairui Song
2025-11-20  2:47 ` Baoquan He

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