Skip to content

Commit db2993a

Browse files
tititiou36idryomov
authored andcommitted
ceph: reorder fields in 'struct ceph_snapid_map'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct ceph_snapid_map' from 72 to 64 bytes. When such a structure is allocated, because of the way memory allocation works, when 72 bytes were requested, 96 bytes were allocated. So, on x86_64, this change saves 32 bytes per allocation and has the structure fit in a single cacheline. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent a5ffd7b commit db2993a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ceph/mds_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ struct ceph_snapid_map {
355355
struct rb_node node;
356356
struct list_head lru;
357357
atomic_t ref;
358-
u64 snap;
359358
dev_t dev;
359+
u64 snap;
360360
unsigned long last_used;
361361
};
362362

0 commit comments

Comments
 (0)