mm-swap-avoid-lock-swap_avail_lock-when-held-cluster-lock.patch removed from -mm tree
The patch titled
Subject: mm, swap: avoid lock swap_avail_lock when held cluster lock
has been removed from the -mm tree. Its filename was
mm-swap-avoid-lock-swap_avail_lock-when-held-cluster-lock.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Huang Ying <[email protected]>
Subject: mm, swap: avoid lock swap_avail_lock when held cluster lock
Cluster lock is used to protect the swap_cluster_info and corresponding elements in swap_info_struct->swap_map[]. But it is found that now in scan_swap_map_slots(), swap_avail_lock may be acquired when cluster lock is held. This does no good except making the locking more complex and improving the potential locking contention, because the swap_info_struct->lock is used to protect the data structure operated in the code already. Fix this via moving the corresponding operations in scan_swap_map_slots() out of cluster lock.
---
mm/swapfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/swapfile.c renamed from mm/swapfile.c~mm-swap-avoid-lock-swap_avail_lock-when-held-cluster-lock +3 -3
@@ -672,6 +672,9 @@ checks:else goto done; } + si->swap_map[offset] = usage; +inc_cluster_info_page (si, si->cluster_info, offset); +unlock_cluster (ci);if (offset == si->lowest_bit) si->lowest_bit++;
@@ -685,9 +688,6 @@ checks:plist_del (&si->avail_list, &swap_avail_head);spin_unlock (&swap_avail_lock); } - si->swap_map[offset] = usage; -inc_cluster_info_page (si, si->cluster_info, offset); -unlock_cluster (ci); si->cluster_next = offset +1 ; slots[n_ret++] =swp_entry (si->type, offset);
_
Patches currently in -mm which might be from [email protected] are
mm-swap-use-kvzalloc-to-allocate-some-swap-data-structure.patch