Skip to content

Commit

Permalink
blk-iolatency: deal with nr_requests == 1
Browse files Browse the repository at this point in the history
Hitting the case where blk_queue_depth() returned 1 uncovered the fact
that iolatency doesn't actually handle this case properly, it simply
doesn't scale down anybody.  For this case we should go straight into
applying the time delay, which we weren't doing.  Since we already limit
the floor at 1 request this if statement is not needed, and this allows
us to set our depth to 1 which allows us to apply the delay if needed.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Josef Bacik authored and Jens Axboe committed Sep 28, 2018
1 parent ff4cee0 commit 9f60511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-iolatency.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static void scale_change(struct iolatency_grp *iolat, bool up)
iolat->rq_depth.max_depth = old;
wake_up_all(&iolat->rq_wait.wait);
}
} else if (old > 1) {
} else {
old >>= 1;
iolat->rq_depth.max_depth = max(old, 1UL);
}
Expand Down

0 comments on commit 9f60511

Please sign in to comment.