Skip to content

Commit 407728d

Browse files
tititiou36axboe
authored andcommitted
block, bfq: Reorder struct bfq_iocq_bfqq_data
The size of struct bfq_iocq_bfqq_data can be reduced by moving a few fields around. On a x86_64, with allmodconfig, this shrinks the size from 144 to 128 bytes. The main benefit is to reduce the size of struct bfq_io_cq from 1360 to 1232. This structure is stored in a dedicated slab cache. So reducing its size improves cache usage. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/79394db1befaa658e8066b8e3348073ce27d9d26.1754119538.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jens Axboe <[email protected]>
1 parent 984ff00 commit 407728d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

block/bfq-iosched.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,6 @@ struct bfq_iocq_bfqq_data {
427427
*/
428428
bool saved_IO_bound;
429429

430-
u64 saved_io_start_time;
431-
u64 saved_tot_idle_time;
432-
433430
/*
434431
* Same purpose as the previous fields for the values of the
435432
* field keeping the queue's belonging to a large burst
@@ -450,20 +447,23 @@ struct bfq_iocq_bfqq_data {
450447
*/
451448
unsigned int saved_weight;
452449

450+
u64 saved_io_start_time;
451+
u64 saved_tot_idle_time;
452+
453453
/*
454454
* Similar to previous fields: save wr information.
455455
*/
456456
unsigned long saved_wr_coeff;
457457
unsigned long saved_last_wr_start_finish;
458458
unsigned long saved_service_from_wr;
459459
unsigned long saved_wr_start_at_switch_to_srt;
460-
unsigned int saved_wr_cur_max_time;
461460
struct bfq_ttime saved_ttime;
461+
unsigned int saved_wr_cur_max_time;
462462

463463
/* Save also injection state */
464-
u64 saved_last_serv_time_ns;
465464
unsigned int saved_inject_limit;
466465
unsigned long saved_decrease_time_jif;
466+
u64 saved_last_serv_time_ns;
467467

468468
/* candidate queue for a stable merge (due to close creation time) */
469469
struct bfq_queue *stable_merge_bfqq;

0 commit comments

Comments
 (0)