aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorShaohua Li <shli@kernel.org>2013-02-22 19:34:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:17 -0500
commit33806f06da654092182410d974b6d3c5396ea3eb (patch)
tree7f7da99d94481a1d4c78ebf05b410fc8ba654a39 /mm/memcontrol.c
parent9800339b5e0f0e24ab3dac349e0de80d2018832e (diff)
swap: make each swap partition have one address_space
When I use several fast SSD to do swap, swapper_space.tree_lock is heavily contended. This makes each swap partition have one address_space to reduce the lock contention. There is an array of address_space for swap. The swap entry type is the index to the array. In my test with 3 SSD, this increases the swapout throughput 20%. [akpm@linux-foundation.org: revert unneeded change to __add_to_swap_cache] Signed-off-by: Shaohua Li <shli@fusionio.com> Cc: Hugh Dickins <hughd@google.com> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c878b1c69510..f85861531f22 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6307,7 +6307,7 @@ static struct page *mc_handle_swap_pte(struct vm_area_struct *vma,
6307 * Because lookup_swap_cache() updates some statistics counter, 6307 * Because lookup_swap_cache() updates some statistics counter,
6308 * we call find_get_page() with swapper_space directly. 6308 * we call find_get_page() with swapper_space directly.
6309 */ 6309 */
6310 page = find_get_page(&swapper_space, ent.val); 6310 page = find_get_page(swap_address_space(ent), ent.val);
6311 if (do_swap_account) 6311 if (do_swap_account)
6312 entry->val = ent.val; 6312 entry->val = ent.val;
6313 6313
@@ -6348,7 +6348,7 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,
6348 swp_entry_t swap = radix_to_swp_entry(page); 6348 swp_entry_t swap = radix_to_swp_entry(page);
6349 if (do_swap_account) 6349 if (do_swap_account)
6350 *entry = swap; 6350 *entry = swap;
6351 page = find_get_page(&swapper_space, swap.val); 6351 page = find_get_page(swap_address_space(swap), swap.val);
6352 } 6352 }
6353#endif 6353#endif
6354 return page; 6354 return page;