v2
2026-08-20
swap随机修复与清理 · v2
mm/swap 修复与清理:修分配空指针,调整 clusters 初始化顺序,精简 swap_extend_table_try_free()。
原始补丁链接
子 Patch(4)
1/4
mm, swap: Fix potential NULL dereference when trying a sleep table allocation
[mm, swap: Fix potential NULL dereference when trying a sleep table allocation] The root cause of this issue is because multi-tables are updated in non atomic context. To be more specific, the issue c
2/4
mm, swap: Move setup_swap_clusters_info() after SWP_SOLIDSTATE initialization
[mm, swap: Move setup_swap_clusters_info() after SWP_SOLIDSTATE initialization] In setup_swap_clusters_info(), SWP_SOLIDSTATE is used to decide global_cluster allocation. Move setup_swap_clusters_info
3/4
mm, swap: return early from swap_extend_table_try_free() on first non-zero entry
[mm, swap: return early from swap_extend_table_try_free() on first non-zero entry] Return immediately when the first non-zero swap count is found as any non-zero swap count prevents freeing extend_tab
4/4
mm, swap: Remove unneeded swap_extend_table_try_free() in swap_dup_entries_cluster()
删除 swap_dup_entries_cluster() 中多余的 swap_extend_table_try_free() 调用;该释放逻辑已由 __swap_cluster_put_entry() 在锁内完成,避免重复操作。