]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - block/bfq-iosched.h
block, bfq: lower-bound the estimated peak rate to 1
authorPaolo Valente <paolo.valente@linaro.org>
Mon, 26 Mar 2018 14:06:24 +0000 (16:06 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Mar 2018 16:18:27 +0000 (10:18 -0600)
commitbc56e2cafa3f80954a278d74bd18349ac3cb8fa5
treebf66485253e3055c244b2475c063e66b90657bc3
parentd558fb51ad3dc7d5f1287d55d0f2e0646af36253
block, bfq: lower-bound the estimated peak rate to 1

If a storage device handled by BFQ happens to be slower than 7.5 KB/s
for a certain amount of time (in the order of a second), then the
estimated peak rate of the device, maintained in BFQ, becomes equal to
0. The reason is the limited precision with which the rate is
represented (details on the range of representable values in the
comments introduced by this commit). This leads to a division-by-zero
error where the estimated peak rate is used as divisor. Such a type of
failure has been reported in [1].

This commit addresses this issue by:
1. Lower-bounding the estimated peak rate to 1
2. Adding and improving comments on the range of rates representable

[1] https://www.spinics.net/lists/kernel/msg2739205.html

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c
block/bfq-iosched.h