linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/bfq: Enable I/O statistics
@ 2022-06-13 16:32 Bart Van Assche
  2022-06-14 13:09 ` Jan Kara
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bart Van Assche @ 2022-06-13 16:32 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Cixi Geng,
	Jan Kara, Yu Kuai, Paolo Valente

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: Jan Kara <jack@suse.cz>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/bfq-iosched.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 0d46cb728bbf..519862d82473 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -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:

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] block/bfq: Enable I/O statistics
  2022-06-13 16:32 [PATCH] block/bfq: Enable I/O statistics Bart Van Assche
@ 2022-06-14 13:09 ` Jan Kara
  2022-06-16 20:50 ` Jens Axboe
  2022-06-17 11:37 ` Jens Axboe
  2 siblings, 0 replies; 6+ messages in thread
From: Jan Kara @ 2022-06-14 13:09 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Cixi Geng, Jan Kara,
	Yu Kuai, Paolo Valente

On Mon 13-06-22 09:32:34, Bart Van Assche wrote:
> 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: Jan Kara <jack@suse.cz>
> Cc: Yu Kuai <yukuai3@huawei.com>
> Cc: Paolo Valente <paolo.valente@unimore.it>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

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

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  block/bfq-iosched.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 0d46cb728bbf..519862d82473 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -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:
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block/bfq: Enable I/O statistics
  2022-06-13 16:32 [PATCH] block/bfq: Enable I/O statistics Bart Van Assche
  2022-06-14 13:09 ` Jan Kara
@ 2022-06-16 20:50 ` Jens Axboe
  2022-06-16 21:14   ` Bart Van Assche
  2022-06-17 11:37 ` Jens Axboe
  2 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2022-06-16 20:50 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, Cixi Geng, Jan Kara, Yu Kuai,
	Paolo Valente

On 6/13/22 10:32 AM, Bart Van Assche wrote:
> 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?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block/bfq: Enable I/O statistics
  2022-06-16 20:50 ` Jens Axboe
@ 2022-06-16 21:14   ` Bart Van Assche
  2022-06-16 22:59     ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2022-06-16 21:14 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Cixi Geng, Jan Kara, Yu Kuai,
	Paolo Valente

On 6/16/22 13:50, Jens Axboe wrote:
> On 6/13/22 10:32 AM, Bart Van Assche wrote:
>> 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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block/bfq: Enable I/O statistics
  2022-06-16 21:14   ` Bart Van Assche
@ 2022-06-16 22:59     ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2022-06-16 22:59 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, Cixi Geng, Jan Kara, Yu Kuai,
	Paolo Valente

On 6/16/22 3:14 PM, Bart Van Assche wrote:
> On 6/16/22 13:50, Jens Axboe wrote:
>> On 6/13/22 10:32 AM, Bart Van Assche wrote:
>>> 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.

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

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block/bfq: Enable I/O statistics
  2022-06-13 16:32 [PATCH] block/bfq: Enable I/O statistics Bart Van Assche
  2022-06-14 13:09 ` Jan Kara
  2022-06-16 20:50 ` Jens Axboe
@ 2022-06-17 11:37 ` Jens Axboe
  2 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2022-06-17 11:37 UTC (permalink / raw)
  To: bvanassche; +Cc: jack, hch, linux-block, cixi.geng1, yukuai3, paolo.valente

On Mon, 13 Jun 2022 09:32:34 -0700, Bart Van Assche wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-17 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-13 16:32 [PATCH] block/bfq: Enable I/O statistics Bart Van Assche
2022-06-14 13:09 ` Jan Kara
2022-06-16 20:50 ` Jens Axboe
2022-06-16 21:14   ` Bart Van Assche
2022-06-16 22:59     ` Jens Axboe
2022-06-17 11:37 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).