v3
2026-08-09
swapoff扫描跳过空簇 · v3
swapoff的find_next_to_unuse按簇跳过空簇,以一次计数器读取替代整簇表项遍历,v3加min_t限制终点。
原始补丁链接
子 Patch(2)
1/2
mm/swap: fix stale comment on swap_info_struct::cluster_info
setup_swap_clusters_info() allocates cluster_info for every swap area, not only for SSDs. Signed-off-by: Youngjun Park youngjun.park@lge.com Acked-by: Kairui Song kasong@tencent.com Reviewed-by:
2/2
mm/swap: scan by cluster in find_next_to_unuse()
find_next_to_unuse() walks every offset from 0 to si->max, and swapoff restarts that walk on each retry, so the cost scales with the size of the device rather than with the few slots the shmem and mml