[PATCH 1/5] blk-iolatency: clear use_delay when io.latency is set to zero

From: Tejun Heo
Date: Thu Jun 13 2019 - 18:35:35 EST


If use_delay was non-zero when the latency target of a cgroup was set
to zero, it will stay stuck until io.latency is enabled on the cgroup
again. This keeps readahead disabled for the cgroup impacting
performance negatively.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Cc: Josef Bacik <jbacik@xxxxxx>
Fixes: d70675121546 ("block: introduce blk-iolatency io controller")
Cc: stable@xxxxxxxxxxxxxxx # v4.19+
---
block/blk-iolatency.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index d22e61bced86..17896bb3aaf2 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -778,8 +778,10 @@ static int iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)

if (!oldval && val)
return 1;
- if (oldval && !val)
+ if (oldval && !val) {
+ blkcg_clear_delay(blkg);
return -1;
+ }
return 0;
}

--
2.17.1