Skip to contentSkip to conversation

mm/swap: Free swap slots in batch

PATCH Superseded Tim Chen 1 participant 1 message Sep 27, 2016

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Tim Chen

author
#0 lore raw

PATCH 6/8 mm/swap: Free swap slots in batch

Add new functions that free unused swap slots in batches without the need to reacquire swap info lock. This improves scalability and reduce lock contention.

---
 include/linux/swap.h |   1 +
 mm/swapfile.c        | 155 +++++++++++++++++++++++++++++++--------------------
 2 files changed, 95 insertions(+), 61 deletions(-)
include/linux/swap.h +1 -0
index 4cacbc8..e95a08e 100644
@@ -418,6 +418,7 @@ extern int swap_duplicate(swp_entry_t);
 extern int swapcache_prepare(swp_entry_t);
 extern void swap_free(swp_entry_t);
 extern void swapcache_free(swp_entry_t);
+extern void swapcache_free_entries(swp_entry_t *entries, int n);
 extern int free_swap_and_cache(swp_entry_t);
 extern int swap_type_of(dev_t, sector_t, struct block_device **);
 extern unsigned int count_swap_pages(int, int);
mm/swapfile.c +94 -61

212 lines not on this page · raw message

Signature · 7 lines
2.5.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>