From: Jens Axboe <axboe@kernel.dk>
To: Alexander Gordeev <agordeev@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] blk-mq: Eliminate superfluous check of BLK_MQ_S_TAG_ACTIVE flag
Date: Wed, 03 Sep 2014 14:40:14 -0600 [thread overview]
Message-ID: <54077CAE.203@kernel.dk> (raw)
In-Reply-To: <871ad1488e7050fa53412b891bf3d0a46dea8bcd.1409775956.git.agordeev@redhat.com>
On 09/03/2014 02:33 PM, Alexander Gordeev wrote:
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> ---
> block/blk-mq-tag.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 4953b64..d1eb579 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -60,8 +60,7 @@ static inline void bt_index_atomic_inc(atomic_t *index)
> */
> void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> {
> - if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) &&
> - !test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
> + if (!test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
> atomic_inc(&hctx->tags->active_queues);
That's done on purpose as well, it's a lot faster to do the (non-atomic)
check first and only do the expensive test and set if needed.
See 7fcbbaf18392 for similar construct and actual numbers on a real case.
--
Jens Axboe
next prev parent reply other threads:[~2014-09-03 20:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 20:33 [PATCH 0/3] blk-mq: Minor tweaks Alexander Gordeev
2014-09-03 20:33 ` [PATCH 1/3] blk-mq: Cleanup blk_mq_tag_busy() and blk_mq_tag_idle() Alexander Gordeev
2014-09-03 20:35 ` Jens Axboe
2014-09-05 1:26 ` Chuck Ebbert
2014-09-05 1:30 ` Jens Axboe
2014-09-05 1:58 ` Chuck Ebbert
2014-09-03 20:33 ` [PATCH 2/3] blk-mq: Eliminate superfluous check of BLK_MQ_S_TAG_ACTIVE flag Alexander Gordeev
2014-09-03 20:40 ` Jens Axboe [this message]
2014-09-03 20:33 ` [PATCH 3/3] blk-mq: Fix formula to calculate fair share of tags Alexander Gordeev
2014-09-03 20:43 ` 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=54077CAE.203@kernel.dk \
--to=axboe@kernel.dk \
--cc=agordeev@redhat.com \
--cc=linux-kernel@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