Skip to content

Commit

Permalink
block/bfq: Enable I/O statistics
Browse files Browse the repository at this point in the history
BFQ uses io_start_time_ns. That member variable is only set if I/O
statistics are enabled. Hence this patch that enables I/O statistics
at the time BFQ is associated with a request queue.

Compile-tested only.

Reported-by: Cixi Geng <cixi.geng1@unisoc.com>
Cc: Cixi Geng <cixi.geng1@unisoc.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Paolo Valente <paolo.valente@unimore.it>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Bart Van Assche authored and Jens Axboe committed Jun 16, 2022
1 parent 6cfeadb commit b96f3ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7046,6 +7046,7 @@ static void bfq_exit_queue(struct elevator_queue *e)
spin_unlock_irq(&bfqd->lock);
#endif

blk_stat_disable_accounting(bfqd->queue);
wbt_enable_default(bfqd->queue);

kfree(bfqd);
Expand Down Expand Up @@ -7192,6 +7193,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);

wbt_disable_default(q);
blk_stat_enable_accounting(q);

return 0;

out_free:
Expand Down

0 comments on commit b96f3ca

Please sign in to comment.