diff options
author | David Sterba <dsterba@suse.com> | 2018-04-09 17:42:40 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-04-24 13:00:12 +0200 |
commit | 944974b4854e3f274e1beaa8165765eb385d8558 (patch) | |
tree | 45737fafea6bc0e5aa3529a53a047af77e7d454a /extent_io.h | |
parent | 26c1dafbf60182610744bba427583c0fdd8d0327 (diff) |
btrfs-progs: reorder extent buffer members for better packing
Afther the fs_info was added, the size was over 128 bytes but we still
have 8 bytes of holes, so with minor reordering we get back to that size.
Before:
struct extent_buffer {
struct cache_extent cache_node; /* 0 48 */
u64 start; /* 48 8 */
u64 dev_bytenr; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
u32 len; /* 64 4 */
/* XXX 4 bytes hole, try to pack */
struct extent_io_tree * tree; /* 72 8 */
struct list_head lru; /* 80 16 */
struct list_head recow; /* 96 16 */
int refs; /* 112 4 */
u32 flags; /* 116 4 */
int fd; /* 120 4 */
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 2 boundary (128 bytes) --- */
struct btrfs_fs_info * fs_info; /* 128 8 */
char data[0]; /* 136 0 */
/* size: 136, cachelines: 3, members: 12 */
/* sum members: 128, holes: 2, sum holes: 8 */
/* last cacheline: 8 bytes */
};
After:
struct extent_buffer {
struct cache_extent cache_node; /* 0 48 */
u64 start; /* 48 8 */
u64 dev_bytenr; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
struct extent_io_tree * tree; /* 64 8 */
struct list_head lru; /* 72 16 */
struct list_head recow; /* 88 16 */
u32 len; /* 104 4 */
int refs; /* 108 4 */
u32 flags; /* 112 4 */
int fd; /* 116 4 */
struct btrfs_fs_info * fs_info; /* 120 8 */
/* --- cacheline 2 boundary (128 bytes) --- */
char data[0]; /* 128 0 */
/* size: 128, cachelines: 2, members: 12 */
};
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent_io.h')
-rw-r--r-- | extent_io.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extent_io.h b/extent_io.h index f8f73089..d407d93d 100644 --- a/extent_io.h +++ b/extent_io.h @@ -91,10 +91,10 @@ struct extent_buffer { struct cache_extent cache_node; u64 start; u64 dev_bytenr; - u32 len; struct extent_io_tree *tree; struct list_head lru; struct list_head recow; + u32 len; int refs; u32 flags; int fd; |