linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Christoph Hellwig <hch@infradead.org>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH] blk-mq: Swap two calls in blk_mq_exit_queue()
Date: Fri, 14 May 2021 08:55:51 +0800	[thread overview]
Message-ID: <YJ3Kl37kPJo650mv@T590> (raw)
In-Reply-To: <20210513171529.7977-1-bvanassche@acm.org>

On Thu, May 13, 2021 at 10:15:29AM -0700, Bart Van Assche wrote:
> If a tag set is shared across request queues (e.g. SCSI LUNs) then the
> block layer core keeps track of the number of active request queues in
> tags->active_queues. blk_mq_tag_busy() and blk_mq_tag_idle() update that
> atomic counter if the hctx flag BLK_MQ_F_TAG_QUEUE_SHARED is set. Make
> sure that blk_mq_exit_queue() calls blk_mq_tag_idle() before that flag is
> cleared by blk_mq_del_queue_tag_set().
> 
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.com>
> Fixes: 0d2602ca30e4 ("blk-mq: improve support for shared tags maps")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  block/blk-mq.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 1ea012de60eb..96b8e3164835 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -3289,10 +3289,12 @@ EXPORT_SYMBOL(blk_mq_init_allocated_queue);
>  /* tags can _not_ be used after returning from blk_mq_exit_queue */
>  void blk_mq_exit_queue(struct request_queue *q)
>  {
> -	struct blk_mq_tag_set	*set = q->tag_set;
> +	struct blk_mq_tag_set *set = q->tag_set;
>  
> -	blk_mq_del_queue_tag_set(q);
> +	/* Checks hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED. */
>  	blk_mq_exit_hw_queues(q, set, set->nr_hw_queues);
> +	/* May clear BLK_MQ_F_TAG_QUEUE_SHARED in hctx->flags. */
> +	blk_mq_del_queue_tag_set(q);
>  }
>  
>  static int __blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
> 

Looks fine:

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

-- 
Ming


  reply	other threads:[~2021-05-14  0:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 17:15 [PATCH] blk-mq: Swap two calls in blk_mq_exit_queue() Bart Van Assche
2021-05-14  0:55 ` Ming Lei [this message]
2021-05-14 14:59 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJ3Kl37kPJo650mv@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).