]> git.ipfire.org Git - thirdparty/linux.git/commit
mm/swap: fix wrong plist empty check in swap_alloc_slow()
authorYoungjun Park <youngjun.park@lge.com>
Wed, 19 Nov 2025 11:41:36 +0000 (20:41 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 24 Nov 2025 23:08:56 +0000 (15:08 -0800)
commitc23071952394eaef4f06d1b71a90392d2650af0d
tree7b62a669f94d0c05904ef1810c78634785481763
parenta9ce09b15761e0f3a413a4a79097d17e19bd3ec1
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>
mm/swapfile.c