[SRU,B,13/13] blk-wbt: wake up all when we scale up, not down

Message ID 20190110031219.30676-14-mfo@canonical.com
State New
Headers show
  • blk-wbt: fix for LP#1810998
Related show

Commit Message

Mauricio Faria de Oliveira Jan. 10, 2019, 3:12 a.m.
From: Josef Bacik <josef@toxicpanda.com>

BugLink: https://bugs.launchpad.net/bugs/1810998

Tetsuo brought to my attention that I screwed up the scale_up/scale_down
helpers when I factored out the rq-qos code.  We need to wake up all the
waiters when we add slots for requests to make, not when we shrink the
slots.  Otherwise we'll end up things waiting forever.  This was a
mistake and simply puts everything back the way it was.

cc: stable@vger.kernel.org
Fixes: a79050434b45 ("blk-rq-qos: refactor out common elements of blk-wbt")
eported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 5e65a20341e02df637d1c16cd487858d2c6a876a)
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
 block/blk-wbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index 0a68645aae6b..9e9d733bae77 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -305,6 +305,7 @@  static void scale_up(struct rq_wb *rwb)
 	rwb->unknown_cnt = 0;
+	rwb_wake_all(rwb);
 	rwb_trace_step(rwb, "scale up");
@@ -313,7 +314,6 @@  static void scale_down(struct rq_wb *rwb, bool hard_throttle)
 	rq_depth_scale_down(&rwb->rq_depth, hard_throttle);
 	rwb->unknown_cnt = 0;
-	rwb_wake_all(rwb);
 	rwb_trace_step(rwb, "scale down");