Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/swap: fix wrong plist empty check in swap_alloc_slow()

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.

Link: https://lkml.kernel.org/r/20251119114136.594108-1-youngjun.park@lge.com
Fixes: 8e689f8ea45f ("mm/swap: do not choose swap device according to numa node")
Signed-off-by: Youngjun Park <youngjun.park@lge.com>
Acked-by: Kairui Song <kasong@tencent.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Youngjun Park and committed by
Andrew Morton
c2307195 a9ce09b1

+1 -1
+1 -1
mm/swapfile.c
··· 1374 1374 * still in the swap_avail_head list then try it, otherwise 1375 1375 * start over if we have not gotten any slots. 1376 1376 */ 1377 - if (plist_node_empty(&si->avail_list)) 1377 + if (plist_node_empty(&next->avail_list)) 1378 1378 goto start_over; 1379 1379 } 1380 1380 spin_unlock(&swap_avail_lock);