From: Ming Lei <ming.lei@redhat.com>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] blk-mq: use right tag offset after wait
Date: Thu, 3 Dec 2020 14:49:31 +0800 [thread overview]
Message-ID: <20201203064931.GB629758@T590> (raw)
In-Reply-To: <beee275f48a98e42f073ee63221e9610fc9470b5.1606699505.git.asml.silence@gmail.com>
On Mon, Nov 30, 2020 at 01:36:25AM +0000, Pavel Begunkov wrote:
> blk_mq_get_tag() selects tag_offset in the beginning and doesn't update
> it even though the tag set it may have changed hw queue during waiting.
>
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> block/blk-mq-tag.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 9c92053e704d..dbbf11edf9a6 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -101,10 +101,8 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
> return BLK_MQ_NO_TAG;
> }
> bt = tags->breserved_tags;
> - tag_offset = 0;
> } else {
> bt = tags->bitmap_tags;
> - tag_offset = tags->nr_reserved_tags;
> }
>
> tag = __blk_mq_get_tag(data, bt);
> @@ -167,6 +165,11 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
> sbitmap_finish_wait(bt, ws, &wait);
>
> found_tag:
> + if (data->flags & BLK_MQ_REQ_RESERVED)
> + tag_offset = 0;
> + else
> + tag_offset = tags->nr_reserved_tags;
> +
So far, the tag offset is tag-set wide, and 'tag_offset' is same for all tags,
looks no need to add the extra check.
thanks,
Ming
next prev parent reply other threads:[~2020-12-03 6:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 1:36 [PATCH 0/3] cleanups/fix for blk_mq_get_tag() Pavel Begunkov
2020-11-30 1:36 ` [PATCH 1/3] blk-mq: use right tag offset after wait Pavel Begunkov
2020-12-03 6:49 ` Ming Lei [this message]
2020-12-03 12:06 ` Pavel Begunkov
2020-11-30 1:36 ` [PATCH 2/3] blk-mq: deduplicate blk_mq_get_tag() bits Pavel Begunkov
2020-11-30 1:36 ` [PATCH 3/3] blk-mq: idiomatic use of WARN_ON_ONCE Pavel Begunkov
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=20201203064931.GB629758@T590 \
--to=ming.lei@redhat.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--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).