nvmet: reorder fields in 'struct nvmf_ctrl_options'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 1 May 2023 12:40:27 +0000 (14:40 +0200)
committerKeith Busch <kbusch@kernel.org>
Mon, 12 Jun 2023 17:36:47 +0000 (10:36 -0700)
commite64b0c807cdb7e1c8c6cd1a1b4e72027d1034d91
tree625393058e7ed0c2f32812a2a90e9e1d04a3ab27
parent9d217fb0e778d69b2e3988efbc441976c0fb29b5
nvmet: reorder fields in 'struct nvmf_ctrl_options'

Group some variables based on their sizes to reduce holes.
On x86_64, this shrinks the size of 'struct nvmf_ctrl_options' from 136 to
128 bytes.

When such a structure is allocated in nvmf_create_ctrl(), because of the
way memory allocation works, when 136 bytes were requested, 192 bytes were
allocated.

So this saves 64 bytes per allocation, 1 cache line to hold the whole
structure and a few cycles when zeroing the memory in nvmf_create_ctrl().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/fabrics.h