Skip to content

Commit 9d217fb

Browse files
tititiou36keithbusch
authored andcommitted
nvme: reorder fields in 'struct nvme_ctrl'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvme_ctrl' from 5368 to 5344 bytes when all CONFIG_* are defined. This structure is embedded into some other structures, so it helps reducing their size as well. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent c60651e commit 9d217fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/nvme.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ enum nvme_ctrl_flags {
246246

247247
struct nvme_ctrl {
248248
bool comp_seen;
249-
enum nvme_ctrl_state state;
250249
bool identified;
250+
enum nvme_ctrl_state state;
251251
spinlock_t lock;
252252
struct mutex scan_lock;
253253
const struct nvme_ctrl_ops *ops;
@@ -279,8 +279,8 @@ struct nvme_ctrl {
279279
char name[12];
280280
u16 cntlid;
281281

282-
u32 ctrl_config;
283282
u16 mtfa;
283+
u32 ctrl_config;
284284
u32 queue_count;
285285

286286
u64 cap;
@@ -353,10 +353,10 @@ struct nvme_ctrl {
353353
bool apst_enabled;
354354

355355
/* PCIe only: */
356+
u16 hmmaxd;
356357
u32 hmpre;
357358
u32 hmmin;
358359
u32 hmminds;
359-
u16 hmmaxd;
360360

361361
/* Fabrics only */
362362
u32 ioccsz;

0 commit comments

Comments
 (0)