aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/swap.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 8a3c4a1caa14..24db9142e93b 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -199,6 +199,16 @@ struct swap_cluster_info {
199#define CLUSTER_FLAG_NEXT_NULL 2 /* This cluster has no next cluster */ 199#define CLUSTER_FLAG_NEXT_NULL 2 /* This cluster has no next cluster */
200 200
201/* 201/*
202 * We assign a cluster to each CPU, so each CPU can allocate swap entry from
203 * its own cluster and swapout sequentially. The purpose is to optimize swapout
204 * throughput.
205 */
206struct percpu_cluster {
207 struct swap_cluster_info index; /* Current cluster index */
208 unsigned int next; /* Likely next allocation offset */
209};
210
211/*
202 * The in-memory structure used to track swap areas. 212 * The in-memory structure used to track swap areas.
203 */ 213 */
204struct swap_info_struct { 214struct swap_info_struct {
@@ -217,6 +227,7 @@ struct swap_info_struct {
217 unsigned int inuse_pages; /* number of those currently in use */ 227 unsigned int inuse_pages; /* number of those currently in use */
218 unsigned int cluster_next; /* likely index for next allocation */ 228 unsigned int cluster_next; /* likely index for next allocation */
219 unsigned int cluster_nr; /* countdown to next cluster search */ 229 unsigned int cluster_nr; /* countdown to next cluster search */
230 struct percpu_cluster __percpu *percpu_cluster; /* per cpu's swap location */
220 struct swap_extent *curr_swap_extent; 231 struct swap_extent *curr_swap_extent;
221 struct swap_extent first_swap_extent; 232 struct swap_extent first_swap_extent;
222 struct block_device *bdev; /* swap device or bdev of swap file */ 233 struct block_device *bdev; /* swap device or bdev of swap file */