From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag
Date: Tue, 30 Jun 2020 14:13:45 +0800 [thread overview]
Message-ID: <20200630061345.GA2159457@T590> (raw)
In-Reply-To: <20200630050557.GE17653@infradead.org>
On Tue, Jun 30, 2020 at 06:05:57AM +0100, Christoph Hellwig wrote:
> > 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.
OK, we can do that in this patch.
>
> > - 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.
blk_mq_tag_busy() is needed for either none and io scheduler, so it
is moved into blk_mq_get_driver_tag(), then check on BLK_MQ_REQ_INTERNAL
is gone.
>
> > 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.
I think it is fine to leave it as-is, since what the patch does is just
to move blk_mq_tag_busy() & the RQF_MQ_INFLIGHT part from __blk_mq_get_driver_tag
to blk_mq_get_driver_tag().
Thanks,
Ming
next prev parent reply other threads:[~2020-06-30 6:14 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
2020-06-30 6:13 ` Ming Lei [this message]
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=20200630061345.GA2159457@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--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).