Skip to content

blk-wbt: Always change enable_state to MANUAL when setting latency - #1162

Open
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1149222=>linus-master
Open

blk-wbt: Always change enable_state to MANUAL when setting latency#1162
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1149222=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

Pull request for series with
subject: blk-wbt: Always change enable_state to MANUAL when setting latency
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=1149222

Commit 1e56f30 ("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: 1e56f30 ("block: Make WBT latency writes honor enable state")
Reviewed-by: Yu Kuai <yukuai@fygo.io>
Reviewed-by: Guzebing <guzebing1612@gmail.com>
Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
@blktests-ci

blktests-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown
Author

Upstream branch: bd5f485
series: https://patchwork.kernel.org/project/linux-block/list/?series=1149222
version: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants