Skip to content

Commit d88cbbb

Browse files
tititiou36axboe
authored andcommitted
blk-mq: Reorder fields in 'struct blk_mq_tag_set'
Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct blk_mq_tag_set' from 304 to 296 bytes. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/6f249f9b02a3490283ef0278096556de41aa0cf0.1676626130.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jens Axboe <[email protected]>
1 parent e5cfefa commit d88cbbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/blk-mq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,14 @@ enum hctx_type {
473473

474474
/**
475475
* struct blk_mq_tag_set - tag set that can be shared between request queues
476+
* @ops: Pointers to functions that implement block driver behavior.
476477
* @map: One or more ctx -> hctx mappings. One map exists for each
477478
* hardware queue type (enum hctx_type) that the driver wishes
478479
* to support. There are no restrictions on maps being of the
479480
* same size, and it's perfectly legal to share maps between
480481
* types.
481482
* @nr_maps: Number of elements in the @map array. A number in the range
482483
* [1, HCTX_MAX_TYPES].
483-
* @ops: Pointers to functions that implement block driver behavior.
484484
* @nr_hw_queues: Number of hardware queues supported by the block driver that
485485
* owns this data structure.
486486
* @queue_depth: Number of tags per hardware queue, reserved tags included.
@@ -505,9 +505,9 @@ enum hctx_type {
505505
* (BLK_MQ_F_BLOCKING).
506506
*/
507507
struct blk_mq_tag_set {
508+
const struct blk_mq_ops *ops;
508509
struct blk_mq_queue_map map[HCTX_MAX_TYPES];
509510
unsigned int nr_maps;
510-
const struct blk_mq_ops *ops;
511511
unsigned int nr_hw_queues;
512512
unsigned int queue_depth;
513513
unsigned int reserved_tags;

0 commit comments

Comments
 (0)