summaryrefslogtreecommitdiffstats
path: root/block/blk-wbt.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-11-28 17:40:34 +0100
committerJens Axboe <axboe@fb.com>2016-11-28 18:27:03 +0100
commitd62118b6dd99b8f64350206a6ea6996083b28c9a (patch)
tree18b3dfdeffa55da6509de99f565b789c29599b20 /block/blk-wbt.h
parentblk-wbt: cleanup disable-by-default for CFQ (diff)
downloadlinux-d62118b6dd99b8f64350206a6ea6996083b28c9a.tar.xz
linux-d62118b6dd99b8f64350206a6ea6996083b28c9a.zip
blk-wbt: allow wbt to be enabled always through sysfs
Currently there's no way to enable wbt if it's not enabled in the kernel config by default for a device. Allow a write to the 'wbt_lat_usec' queue sysfs file to enable wbt. This is useful for both the kernel config case, but also if the device is CFQ managed and it was turned off by default. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-wbt.h')
-rw-r--r--block/blk-wbt.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blk-wbt.h b/block/blk-wbt.h
index 8f485f8e1baf..65f1de519f67 100644
--- a/block/blk-wbt.h
+++ b/block/blk-wbt.h
@@ -21,6 +21,15 @@ enum {
WBT_NUM_RWQ = 2,
};
+/*
+ * Enable states. Either off, or on by default (done at init time),
+ * or on through manual setup in sysfs.
+ */
+enum {
+ WBT_STATE_ON_DEFAULT = 1,
+ WBT_STATE_ON_MANUAL = 2,
+};
+
static inline void wbt_clear_state(struct blk_issue_stat *stat)
{
stat->time &= BLK_STAT_TIME_MASK;
@@ -61,6 +70,8 @@ struct rq_wb {
int scale_step;
bool scaled_max;
+ short enable_state; /* WBT_STATE_* */
+
/*
* Number of consecutive periods where we don't have enough
* information to make a firm scale up/down decision.