Commit d5cdf58f authored by Hugh Dickins's avatar Hugh Dickins Committed by james toy

Reorder (and comment) the fields of swap_info_struct, to make better

use of its cachelines: it's good for swap_duplicate() in particular
if unsigned int max and swap_map are near the start.
Signed-off-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0c6005f9
...@@ -167,21 +167,21 @@ struct swap_info_struct { ...@@ -167,21 +167,21 @@ struct swap_info_struct {
signed short prio; /* swap priority of this type */ signed short prio; /* swap priority of this type */
signed char type; /* strange name for an index */ signed char type; /* strange name for an index */
signed char next; /* next type on the swap list */ signed char next; /* next type on the swap list */
struct file *swap_file; unsigned int max; /* extent of the swap_map */
struct block_device *bdev; unsigned char *swap_map; /* vmalloc'ed array of usage counts */
struct swap_extent first_swap_extent; unsigned int lowest_bit; /* index of first free in swap_map */
struct swap_extent *curr_swap_extent; unsigned int highest_bit; /* index of last free in swap_map */
unsigned char *swap_map; unsigned int pages; /* total of usable pages of swap */
unsigned int lowest_bit; unsigned int inuse_pages; /* number of those currently in use */
unsigned int highest_bit; unsigned int cluster_next; /* likely index for next allocation */
unsigned int cluster_nr; /* countdown to next cluster search */
unsigned int lowest_alloc; /* while preparing discard cluster */ unsigned int lowest_alloc; /* while preparing discard cluster */
unsigned int highest_alloc; /* while preparing discard cluster */ unsigned int highest_alloc; /* while preparing discard cluster */
unsigned int cluster_next; struct swap_extent *curr_swap_extent;
unsigned int cluster_nr; struct swap_extent first_swap_extent;
unsigned int pages; struct block_device *bdev; /* swap device or bdev of swap file */
unsigned int max; struct file *swap_file; /* seldom referenced */
unsigned int inuse_pages; unsigned int old_block_size; /* seldom referenced */
unsigned int old_block_size;
}; };
struct swap_list_t { struct swap_list_t {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment