All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag
Date: Tue, 30 Jun 2020 06:05:57 +0100	[thread overview]
Message-ID: <20200630050557.GE17653@infradead.org> (raw)
In-Reply-To: <20200630022356.2149607-4-ming.lei@redhat.com>

> index 21108a550fbf..3b0c5cfe922a 100644
> --- a/block/blk-flush.c
> +++ b/block/blk-flush.c
> @@ -236,12 +236,10 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
>  		error = fq->rq_status;
>  
>  	hctx = flush_rq->mq_hctx;
> +	if (!q->elevator)
>  		flush_rq->tag = -1;
> +	else
>  		flush_rq->internal_tag = -1;

These should switch to BLK_MQ_NO_TAG which you're at it.

> -	if (!(data->flags & BLK_MQ_REQ_INTERNAL))
> -		blk_mq_tag_busy(data->hctx);

BLK_MQ_REQ_INTERNAL is gone now, so this won't apply.

>  static bool blk_mq_get_driver_tag(struct request *rq)
>  {
> +	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
> +	bool shared = blk_mq_tag_busy(rq->mq_hctx);
> +
> +	if (rq->tag == BLK_MQ_NO_TAG && !__blk_mq_get_driver_tag(rq))
> +		return false;
> +
> +	if (shared) {
> +		rq->rq_flags |= RQF_MQ_INFLIGHT;
> +		atomic_inc(&hctx->nr_active);
> +	}
> +	hctx->tags->rqs[rq->tag] = rq;
> +	return true;
>  }

The function seems a bit misnamed now, although I don't have a good
suggestion for a better name.

  reply	other threads:[~2020-06-30  5:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30  2:23 [PATCH 0/3] blk-mq: driver tag related cleanup Ming Lei
2020-06-30  2:23 ` [PATCH 1/3] blk-mq: move blk_mq_get_driver_tag into blk-mq.c Ming Lei
2020-06-30  4:57   ` Christoph Hellwig
2020-06-30  6:10   ` Hannes Reinecke
2020-06-30  2:23 ` [PATCH 2/3] blk-mq: move blk_mq_put_driver_tag() " Ming Lei
2020-06-30  4:58   ` Christoph Hellwig
2020-06-30  6:10   ` Hannes Reinecke
2020-06-30  2:23 ` [PATCH 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag Ming Lei
2020-06-30  5:05   ` Christoph Hellwig [this message]
2020-06-30  6:13     ` Ming Lei
2020-06-30  6:26   ` Hannes Reinecke
2020-06-30  6:43     ` Ming Lei

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=20200630050557.GE17653@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.