summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hugh.dickins@tiscali.co.uk>2009-12-14 17:58:48 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 08:53:16 -0800
commit7509765a29cfb1a4c506c09b304aaf3b4111c653 (patch)
tree1f2de5381e044b452653a3af0f32e403ffe51931
parentaaa468653b4a0d11c603c48d716f765177a5a9e4 (diff)
downloadlinux-7509765a29cfb1a4c506c09b304aaf3b4111c653.tar.bz2
swap_info: reorder its fields
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: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/swap.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index ac43d87b89b0..9f0ca325e30d 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -167,21 +167,21 @@ struct swap_info_struct {
signed short prio; /* swap priority of this type */
signed char type; /* strange name for an index */
signed char next; /* next type on the swap list */
- struct file *swap_file;
- struct block_device *bdev;
- struct swap_extent first_swap_extent;
- struct swap_extent *curr_swap_extent;
- unsigned char *swap_map;
- unsigned int lowest_bit;
- unsigned int highest_bit;
+ unsigned int max; /* extent of the swap_map */
+ unsigned char *swap_map; /* vmalloc'ed array of usage counts */
+ unsigned int lowest_bit; /* index of first free in swap_map */
+ unsigned int highest_bit; /* index of last free in swap_map */
+ unsigned int pages; /* total of usable pages of swap */
+ 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 */
unsigned int lowest_alloc; /* while preparing discard cluster */
unsigned int highest_alloc; /* while preparing discard cluster */
- unsigned int cluster_next;
- unsigned int cluster_nr;
- unsigned int pages;
- unsigned int max;
- unsigned int inuse_pages;
- unsigned int old_block_size;
+ struct swap_extent *curr_swap_extent;
+ struct swap_extent first_swap_extent;
+ struct block_device *bdev; /* swap device or bdev of swap file */
+ struct file *swap_file; /* seldom referenced */
+ unsigned int old_block_size; /* seldom referenced */
};
struct swap_list_t {