mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yu kuai" <yukuai@fygo.io>
To: "Tang Yizhou" <yizhou.tang@shopee.com>, <axboe@kernel.dk>,
	 <guzebing1612@gmail.com>, "yu kuai" <yukuai@fygo.io>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] blk-wbt: Always change enable_state to MANUAL when setting latency
Date: Fri, 24 Jul 2026 14:51:45 +0800	[thread overview]
Message-ID: <2c695292-2fa6-45c1-86e9-d4bf0100debb@fygo.io> (raw)
In-Reply-To: <20260717125021.88825-1-yizhou.tang@shopee.com>

在 2026/7/17 20:50, Tang Yizhou 写道:

> From: Tang Yizhou<yizhou.tang@shopee.com>
>
> Commit 1e56f30a73f3 ("block: Make WBT latency writes honor enable
> state") compares only the boolean enabled state in the no-op check.
> Writing the current latency value while WBT is in WBT_STATE_ON_DEFAULT
> is therefore still skipped, and enable_state is not changed to
> WBT_STATE_ON_MANUAL. A subsequent elevator switch to BFQ then disables
> WBT through wbt_disable_default(), silently discarding the explicit
> sysfs setting:
>
>    # enable_state = WBT_STATE_ON_DEFAULT, min_lat_nsec = 2000000
>    echo 2000 > /sys/block/nullb0/queue/wbt_lat_usec  # skipped as a no-op
>    echo bfq > /sys/block/nullb0/queue/scheduler
>    cat /sys/block/nullb0/queue/wbt_lat_usec          # 0, WBT disabled
>
> Skip the update only if the stored latency matches and enable_state
> already equals the exact target state: WBT_STATE_ON_MANUAL for a
> non-zero value, WBT_STATE_OFF_MANUAL for zero.
>
> A write that passes the check then reaches wbt_set_min_lat(), which
> performs the actual transition to the MANUAL state.
>
> Rename the helper to wbt_lat_changed() to improve readability.
>
> Fixes: 1e56f30a73f3 ("block: Make WBT latency writes honor enable state")
> Signed-off-by: Tang Yizhou<yizhou.tang@shopee.com>
> ---
>   block/blk-wbt.c | 14 +++++++++++---
>   1 file changed, 11 insertions(+), 3 deletions(-)
Reviewed-by: Yu Kuai <yukuai@fygo.io>

-- 
Thanks,
Kuai

  reply	other threads:[~2026-07-24  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 12:50 Tang Yizhou
2026-07-24  6:51 ` yu kuai [this message]
2026-07-31 18:02   ` Tang Yizhou
2026-07-24  9:50 ` guzebing

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=2c695292-2fa6-45c1-86e9-d4bf0100debb@fygo.io \
    --to=yukuai@fygo.io \
    --cc=axboe@kernel.dk \
    --cc=guzebing1612@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yizhou.tang@shopee.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®