[PATCH 0/2] mm/swap: skip empty clusters in the swapoff scan

From: Youngjun Park

Date: Tue Jul 28 2026 - 12:30:13 EST


From: Youngjun Park <her0gyugyu@xxxxxxxxx>

find_next_to_unuse() walks a swap device one offset at a time. Slot
state now lives in a per cluster swap table, so patch 2 dismisses an
empty cluster with one counter read instead of SWAPFILE_CLUSTER table
reads.

Patch 1 is an unrelated one line comment fix noticed on the way.

A counter in the skip branch confirmed it runs, and swapoff completed
with the device under load. No DEBUG_VM or lockdep splats.

Youngjun Park (2):
mm/swap: fix stale comment on swap_info_struct::cluster_info
mm/swap: scan by cluster in find_next_to_unuse()

include/linux/swap.h | 2 +-
mm/swapfile.c | 39 ++++++++++++++++++++++++++-------------
2 files changed, 27 insertions(+), 14 deletions(-)


base-commit: 2a4faffc103297c4822bb269d521249b75cc2261
--
2.48.1