linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue
@ 2022-10-30  8:32 Jinlong Chen
  2022-10-30  8:40 ` Christoph Hellwig
  2022-10-31 13:32 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jinlong Chen @ 2022-10-30  8:32 UTC (permalink / raw)
  To: axboe; +Cc: hch, bvanassche, linux-block, linux-kernel, nickyc975

The calling relationship in blk_mq_destroy_queue() is as follows:

blk_mq_destroy_queue()
    ...
    -> blk_queue_start_drain()
        -> blk_freeze_queue_start()  <- called
        ...
    -> blk_freeze_queue()
        -> blk_freeze_queue_start()  <- called again
        -> blk_mq_freeze_queue_wait()
    ...

So there is a redundant call to blk_freeze_queue_start().

Replace blk_freeze_queue() with blk_mq_freeze_queue_wait() to avoid the
redundant call.

Signed-off-by: Jinlong Chen <nickyc975@zju.edu.cn>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4cecf281123f..8ca49530bdf3 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4005,7 +4005,7 @@ void blk_mq_destroy_queue(struct request_queue *q)
 
 	blk_queue_flag_set(QUEUE_FLAG_DYING, q);
 	blk_queue_start_drain(q);
-	blk_freeze_queue(q);
+	blk_mq_freeze_queue_wait(q);
 
 	blk_sync_queue(q);
 	blk_mq_cancel_work_sync(q);
-- 
2.31.1


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

* Re: [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue
  2022-10-30  8:32 [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue Jinlong Chen
@ 2022-10-30  8:40 ` Christoph Hellwig
  2022-10-31 13:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-10-30  8:40 UTC (permalink / raw)
  To: Jinlong Chen; +Cc: axboe, hch, bvanassche, linux-block, linux-kernel

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue
  2022-10-30  8:32 [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue Jinlong Chen
  2022-10-30  8:40 ` Christoph Hellwig
@ 2022-10-31 13:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-10-31 13:32 UTC (permalink / raw)
  To: Jinlong Chen; +Cc: linux-kernel, hch, linux-block, bvanassche

On Sun, 30 Oct 2022 16:32:12 +0800, Jinlong Chen wrote:
> The calling relationship in blk_mq_destroy_queue() is as follows:
> 
> blk_mq_destroy_queue()
>     ...
>     -> blk_queue_start_drain()
>         -> blk_freeze_queue_start()  <- called
>         ...
>     -> blk_freeze_queue()
>         -> blk_freeze_queue_start()  <- called again
>         -> blk_mq_freeze_queue_wait()
>     ...
> 
> [...]

Applied, thanks!

[1/1] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue
      commit: 56c1ee92246a5099a626b955dd7f6636cdce6f93

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2022-10-31 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-30  8:32 [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue Jinlong Chen
2022-10-30  8:40 ` Christoph Hellwig
2022-10-31 13:32 ` 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).