[PATCH 2/8] blk-mq: skip non-mq queues in blk_mq_quiesce_queue

Ming Lei ming.lei at redhat.com
Thu Oct 20 18:13:29 PDT 2022


On Thu, Oct 20, 2022 at 12:56:02PM +0200, Christoph Hellwig wrote:
> For submit_bio based queues there is no (S)RCU critical section during
> I/O submission and thus nothing to wait for in blk_mq_wait_quiesce_done,
> so skip doing any synchronization.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>  block/blk-mq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 33292c01875d5..df967c8af9fee 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -280,7 +280,9 @@ EXPORT_SYMBOL_GPL(blk_mq_wait_quiesce_done);
>  void blk_mq_quiesce_queue(struct request_queue *q)
>  {
>  	blk_mq_quiesce_queue_nowait(q);
> -	blk_mq_wait_quiesce_done(q);
> +	/* nothing to wait for non-mq queues */
> +	if (queue_is_mq(q))
> +		blk_mq_wait_quiesce_done(q);

This interface can't work as expected for bio drivers, the only user
should be del_gendisk(), but anyway the patch is fine:

Reviewed-by: Ming Lei <ming.lei at redhat.com>

thanks,
Ming




More information about the Linux-nvme mailing list