X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Flinux%2Fswap.h;h=24db9142e93b0ec438c7b04983c5205e78a0c7d0;hb=ebc2a1a69111eadfeda8487e577f1a5d42ef0dae;hp=8a3c4a1caa14f501bac7d812f69ca4cc359ed0f7;hpb=edfe23dac3e2981277087b05bec7fec7790d1835;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git diff --git a/include/linux/swap.h b/include/linux/swap.h index 8a3c4a1..24db914 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -199,6 +199,16 @@ struct swap_cluster_info { #define CLUSTER_FLAG_NEXT_NULL 2 /* This cluster has no next cluster */ /* + * We assign a cluster to each CPU, so each CPU can allocate swap entry from + * its own cluster and swapout sequentially. The purpose is to optimize swapout + * throughput. + */ +struct percpu_cluster { + struct swap_cluster_info index; /* Current cluster index */ + unsigned int next; /* Likely next allocation offset */ +}; + +/* * The in-memory structure used to track swap areas. */ struct swap_info_struct { @@ -217,6 +227,7 @@ struct swap_info_struct { unsigned int inuse_pages; /* number of those currently in use */ unsigned int cluster_next; /* likely index for next allocation */ unsigned int cluster_nr; /* countdown to next cluster search */ + struct percpu_cluster __percpu *percpu_cluster; /* per cpu's swap location */ struct swap_extent *curr_swap_extent; struct swap_extent first_swap_extent; struct block_device *bdev; /* swap device or bdev of swap file */