Skip to contentSkip to conversation

blk-wbt: wake up all when we scale up, not down

PATCH In review Josef Bacik 2 participants 2 messages Oct 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blk-wbt: wake up all when we scale up, not down

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.

Fixes a79050434b45 ("blk-rq-qos: refactor out common elements of blk-wbt")

---
JENS! I did this on for-4.20/block FYI

 block/blk-wbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-wbt.c +1 -1
index 8e20a0677dcf..8ac93fcbaa2e 100644
@@ -310,6 +310,7 @@ static void scale_up(struct rq_wb *rwb)
 	rq_depth_scale_up(&rwb->rq_depth);
 	calc_wb_limits(rwb);
 	rwb->unknown_cnt = 0;
+	rwb_wake_all(rwb);
 	rwb_trace_step(rwb, "scale up");
 }
 
@@ -318,7 +319,6 @@ static void scale_down(struct rq_wb *rwb, bool hard_throttle)
 	rq_depth_scale_down(&rwb->rq_depth, hard_throttle);
 	calc_wb_limits(rwb);
 	rwb->unknown_cnt = 0;
-	rwb_wake_all(rwb);
 	rwb_trace_step(rwb, "scale down");
 }
 
Signature · 1 line
2.14.3
maintainer
#1 lore raw
Quoted 5 lines · Josef Bacik

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.

I'll apply this for 4.19. I haven't hit this in testing, I'm guessing the jitter when going up and down hides the issue.

Signature · 1 line
Jens Axboe