Skip to contentSkip to conversation

block/bfq: Enable I/O statistics

PATCH Applied Bart Van Assche 3 participants 6 messages Jun 13, 2022 – Jun 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/bfq: Enable I/O statistics

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.

---
 block/bfq-iosched.c | 3 +++
 1 file changed, 3 insertions(+)
block/bfq-iosched.c +3 -0
index 0d46cb728bbf..519862d82473 100644
@@ -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);
@@ -7189,6 +7190,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
 	bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
 
 	wbt_disable_default(q);
+	blk_stat_enable_accounting(q);
+
 	return 0;
 
 out_free:
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Bart Van Assche

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.

Quoted 8 lines

Compile-tested only.

Looks good. Thanks for the fix. Feel free to add:

Honza

Quoted 25 lines
---
 block/bfq-iosched.c | 3 +++
 1 file changed, 3 insertions(+)
block/bfq-iosched.c +3 -0
index 0d46cb728bbf..519862d82473 100644
@@ -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);
@@ -7189,6 +7190,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
 	bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
 
 	wbt_disable_default(q);
+	blk_stat_enable_accounting(q);
+
 	return 0;
 
 out_free:
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer
#2 lore raw
In reply to Bart Van Assche
Quoted 5 lines · Bart Van Assche

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.

Have you runtime tested it now?

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 8 lines · Jens Axboe
Quoted 5 lines · Bart Van Assche

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.

Have you runtime tested it now?

This patch has been tested lightly: I ran blktests in a VM against a kernel that includes this patch. I'm not a BFQ expert so I was hoping for feedback from Paolo.

Thanks,

Bart.

maintainer
#4 lore raw
Quoted 6 lines · Bart Van Assche
Quoted 5 lines · Jens Axboe
Quoted 4 lines · Bart Van Assche

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.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Compile-tested only.

Have you runtime tested it now?

This patch has been tested lightly: I ran blktests in a VM against a kernel that includes this patch. I'm not a BFQ expert so I was hoping for feedback from Paolo.

Sounds good - and Jan reviewed it, and I consider him the defactor BFQ maintainer anyway these days :-)

Signature · 1 line
Jens Axboe
maintainer Applied
#5 lore raw
In reply to Bart Van Assche
Quoted 8 lines · Bart Van Assche

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.

[...]

Applied, thanks!

[1/1] block/bfq: Enable I/O statistics
(no commit info)

Best regards,

Signature · 1 line
Jens Axboe