Skip to content

Commit 9d16d26

Browse files
tititiou36keithbusch
authored andcommitted
nvmet: Reorder fields in 'struct nvmet_ns'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmet_ns' from 520 to 512 bytes. When such a structure is allocated in nvmet_ns_alloc(), because of the way memory allocation works, when 520 bytes were requested, 1024 bytes were allocated. So, on x86_64, this change saves 512 bytes per allocation. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent d0dd594 commit 9d16d26

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/target/nvmet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ struct nvmet_ns {
7979
struct completion disable_done;
8080
mempool_t *bvec_pool;
8181

82-
int use_p2pmem;
8382
struct pci_dev *p2p_dev;
83+
int use_p2pmem;
8484
int pi_type;
8585
int metadata_size;
8686
u8 csi;

0 commit comments

Comments
 (0)