]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
btrfs: switch extent_state state to unsigned
authorDavid Sterba <dsterba@suse.cz>
Wed, 14 Jan 2015 18:52:13 +0000 (19:52 +0100)
committerChris Mason <clm@fb.com>
Thu, 22 Jan 2015 02:02:04 +0000 (18:02 -0800)
commit9ee49a047dc53fd21808cbb7f3b6a3345463e834
tree98710aa584c84501c00ecf2227138ff4f44d5396
parent5efa0490cc94aee06cd8d282683e22a8ce0a0026
btrfs: switch extent_state state to unsigned

Currently there's a 4B hole in the structure between refs and state and there
are only 16 bits used so we can make it unsigned. This will get a better
packing and may save some stack space for local variables.

The size of extent_state gets reduced by 8B and there are usually a lot
of slab objects.

struct extent_state {
u64                        start;                /*     0     8 */
u64                        end;                  /*     8     8 */
struct rb_node             rb_node;              /*    16    24 */
wait_queue_head_t          wq;                   /*    40    24 */
/* --- cacheline 1 boundary (64 bytes) --- */
atomic_t                   refs;                 /*    64     4 */

/* XXX 4 bytes hole, try to pack */

long unsigned int          state;                /*    72     8 */
u64                        private;              /*    80     8 */

/* size: 88, cachelines: 2, members: 7 */
/* sum members: 84, holes: 1, sum holes: 4 */
/* last cacheline: 24 bytes */
};

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c
fs/btrfs/tests/extent-io-tests.c