Skip to content

mm/swap: skip empty clusters in the swapoff scan

Youngjun Park linux-mm lkml 2 versions – Applied

Status from this message: [merged mm-stable] mm-swap-scan-by-cluster-in-find_next_to_unuse.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesApplied 2/2
  2. v32 patches 10 repliesSuperseded

Changes in v4 from the cover letter

- 2/2: put the measured swapoff times in the changelog (Andrew)
- 2/2: pick up Kairui's Acked-by and Baoquan's Reviewed-by
- Rebased on mm-new
- Link to v3: https://lore.kernel.org/r/[email protected]

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/swap: fix stale comment on swap_info_struct::cluster_infoinclude/linux/swap.h+1 -10 repliesApplied
2/2mm/swap: scan by cluster in find_next_to_unuse()mm/swapfile.c+30 -131 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKairui SongBarry SongBaoquan HeNhat Pham
1/2A-b R-b
2/2A-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

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

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 debug test confirmed the skip path runs, and swapoff completed under load with no DEBUG_VM or lockdep splats.

Changes in v4:
- 2/2: put the measured swapoff times in the changelog (Andrew)
- 2/2: pick up Kairui's Acked-by and Baoquan's Reviewed-by
- Rebased on mm-new
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- 2/2: clamp the scan end with min_t() so it stops at si->max, rather than running into the masked tail of the last cluster, which drops the need to explain why walking that tail was safe (Barry)
- 2/2: compute ci_off only where it is used
- 1/2, 2/2: pick up Barry's Reviewed-by
- Rebased on mm-new
- Link to v2: https://lore.kernel.org/r/[email protected]

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        | 43 ++++++++++++++++++++++++++++++-------------
 2 files changed, 31 insertions(+), 14 deletions(-)

base-commit: 0bffe67ab8a72b3725cc31c4b525709bd3a3e223

Signature · 1 line
2.48.1