blk-wbt: Always change enable_state to MANUAL when setting latency - #1162
Open
blktests-ci[bot] wants to merge 1 commit into
Open
blk-wbt: Always change enable_state to MANUAL when setting latency#1162blktests-ci[bot] wants to merge 1 commit into
blktests-ci[bot] wants to merge 1 commit into
Conversation
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>
Author
|
Upstream branch: bd5f485 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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