From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
"Ewan D . Milne" <emilne@redhat.com>,
linux-block@vger.kernel.org, David Milburn <dmilburn@redhat.com>,
linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] blk-mq: always allow reserved allocation in hctx_may_queue
Date: Fri, 11 Sep 2020 11:52:58 +0200 [thread overview]
Message-ID: <20200911095258.GA914@lst.de> (raw)
In-Reply-To: <20200911094453.160109-1-ming.lei@redhat.com>
On Fri, Sep 11, 2020 at 05:44:53PM +0800, Ming Lei wrote:
> unsigned int tag_offset = rq->mq_hctx->tags->nr_reserved_tags;
> int tag;
> + bool reserved = blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags,
> + rq->internal_tag);
>
> blk_mq_tag_busy(rq->mq_hctx);
>
> - if (blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags, rq->internal_tag)) {
> + if (reserved) {
> bt = rq->mq_hctx->tags->breserved_tags;
> tag_offset = 0;
> }
>
> - if (!hctx_may_queue(rq->mq_hctx, bt))
> + if (!reserved && !hctx_may_queue(rq->mq_hctx, bt))
What about:
if (blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags, rq->internal_tag)) {
bt = rq->mq_hctx->tags->breserved_tags;
tag_offset = 0;
} else {
if (!hctx_may_queue(rq->mq_hctx, bt))
return false;
}
which seems a little easier to follow?
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-09-11 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 9:44 [PATCH] blk-mq: always allow reserved allocation in hctx_may_queue Ming Lei
2020-09-11 9:52 ` Christoph Hellwig [this message]
2020-09-11 10:01 ` Hannes Reinecke
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=20200911095258.GA914@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dmilburn@redhat.com \
--cc=emilne@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox