blk-throttle: fix zero wait time for iops throttled group
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Mon, 8 Jul 2019 15:29:57 +0000 (18:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:30 +0000 (09:14 +0200)
commit1ab644bd02ab716a981acc0460ebca15784ff127
treed7547e795781cde862ac496fe746ddee1c86ea3d
parent91da712ff592ef3bb1f09060eae0fa391769fbdf
blk-throttle: fix zero wait time for iops throttled group

commit 3a10f999ffd464d01c5a05592a15470a3c4bbc36 upstream.

After commit 991f61fe7e1d ("Blk-throttle: reduce tail io latency when
iops limit is enforced") wait time could be zero even if group is
throttled and cannot issue requests right now. As a result
throtl_select_dispatch() turns into busy-loop under irq-safe queue
spinlock.

Fix is simple: always round up target time to the next throttle slice.

Fixes: 991f61fe7e1d ("Blk-throttle: reduce tail io latency when iops limit is enforced")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-throttle.c