]> git.hungrycats.org Git - linux/commit
btrfs: switch extent_state state to unsigned
authorDavid Sterba <dsterba@suse.cz>
Wed, 14 Jan 2015 18:52:13 +0000 (19:52 +0100)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Fri, 27 Mar 2015 03:26:49 +0000 (23:26 -0400)
commit42aaf778e64105b176c8e691dcd6b1d9e7e3eb91
tree6052a312839bc89f32a2e1dc02da344efa6204be
parentca53016080a9027d327b582e25649d8f6e655b57
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>
(cherry picked from commit 9ee49a047dc53fd21808cbb7f3b6a3345463e834)
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c
fs/btrfs/tests/extent-io-tests.c