From c125311d96b1bfcce0f5930a4f0fdfe39ea14f7c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 23 Aug 2018 09:34:46 -0600 Subject: blk-wbt: don't maintain inflight counts if disabled A previous commit removed the ability to have per-rq flags. We used those flags to maintain inflight counts. Since we don't have those anymore, we have to always maintain inflight counts, even if wbt is disabled. This is clearly suboptimal. Add a queue quiesce around changing the wbt latency settings from sysfs to work around this. With that, we can reliably put the enabled check in our bio_to_wbt_flags(), since we know the WBT_TRACKED flag will be consistent for the lifetime of the request. Fixes: c1c80384c8f ("block: remove external dependency on wbt_flags") Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe --- block/blk-wbt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'block/blk-wbt.c') diff --git a/block/blk-wbt.c b/block/blk-wbt.c index c9358f1981fb..84507d3e9a98 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -540,6 +540,9 @@ static enum wbt_flags bio_to_wbt_flags(struct rq_wb *rwb, struct bio *bio) { enum wbt_flags flags = 0; + if (!rwb_enabled(rwb)) + return 0; + if (bio_op(bio) == REQ_OP_READ) { flags = WBT_READ; } else if (wbt_should_throttle(rwb, bio)) { -- cgit v1.2.3