mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Chaohai Chen" <wdhh6@aliyun.com>, <axboe@kernel.dk>,
	 <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	 <yukuai@fnnas.com>
Subject: Re: [PATCH] blk-mq-sched: Remove redundant code in blk_mq_sched_mark_restart_hctx().
Date: Fri, 16 Jan 2026 15:32:00 +0800	[thread overview]
Message-ID: <1cf65d49-995a-462a-b355-cd28c093592c@fnnas.com> (raw)
In-Reply-To: <20260116061927.1004411-1-wdhh6@aliyun.com>

Hi,

在 2026/1/16 14:19, Chaohai Chen 写道:
> The current purpose of the blk_mq_sched_mark_restart_hctx() function
> is to set the BLK_MQ_S_SCHED_RESTART flag in hctx->state. Just remove
> the redundant judgement.

I don't think this is just redundant. This function is called from IO hot path,
and test_bit() should have less performance overhead than set_bit() if the
state is already set.

>
> Signed-off-by: Chaohai Chen <wdhh6@aliyun.com>
> ---
>   block/blk-mq-sched.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
> index e26898128a7e..2f6c353cb6d0 100644
> --- a/block/blk-mq-sched.c
> +++ b/block/blk-mq-sched.c
> @@ -21,9 +21,6 @@
>    */
>   void blk_mq_sched_mark_restart_hctx(struct blk_mq_hw_ctx *hctx)
>   {
> -	if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state))
> -		return;
> -
>   	set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state);
>   }
>   EXPORT_SYMBOL_GPL(blk_mq_sched_mark_restart_hctx);

-- 
Thansk,
Kuai

      reply	other threads:[~2026-01-16  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  6:19 Chaohai Chen
2026-01-16  7:32 ` Yu Kuai [this message]

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=1cf65d49-995a-462a-b355-cd28c093592c@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wdhh6@aliyun.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

all inboxes | Powered by JetHome®