summaryrefslogtreecommitdiff
path: root/block/blk-wbt.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2022-10-19 20:15:15 +0800
committerJens Axboe <axboe@kernel.dk>2022-10-23 18:59:17 -0600
commita9a236d238a5e8ab2e74ca62c2c7ba5dd435af77 (patch)
tree00317949d6b138449279ed53f8ca090375b92d8d /block/blk-wbt.c
parentb11d31ae01e6b0762b28e645ad6718a12faa8d14 (diff)
blk-wbt: make enable_state more accurate
Currently, if user disable wbt through sysfs, 'enable_state' will be 'WBT_STATE_ON_MANUAL', which will be confusing. Add a new state 'WBT_STATE_OFF_MANUAL' to cover that case. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20221019121518.3865235-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-wbt.c')
-rw-r--r--block/blk-wbt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index c5a8c10028a0..4680691a96bc 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -435,8 +435,13 @@ void wbt_set_min_lat(struct request_queue *q, u64 val)
struct rq_qos *rqos = wbt_rq_qos(q);
if (!rqos)
return;
+
RQWB(rqos)->min_lat_nsec = val;
- RQWB(rqos)->enable_state = WBT_STATE_ON_MANUAL;
+ if (val)
+ RQWB(rqos)->enable_state = WBT_STATE_ON_MANUAL;
+ else
+ RQWB(rqos)->enable_state = WBT_STATE_OFF_MANUAL;
+
wbt_update_limits(RQWB(rqos));
}