]> git.baikalelectronics.ru Git - kernel.git/commit
iocost: consider iocgs with active delays for debt forgiveness
authorTejun Heo <tj@kernel.org>
Fri, 18 Sep 2020 18:41:27 +0000 (14:41 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 25 Sep 2020 14:35:02 +0000 (08:35 -0600)
commitba026244c31e62a4a71133a20b45e074a0d1d5e8
tree964cf1a1fd23ca0155677c8cdf536df0c78993be
parentb3c95eef9dc1d1b2eb6d43e528f28eaacd5d9bc1
iocost: consider iocgs with active delays for debt forgiveness

An iocg may have 0 debt but non-zero delay. The current debt forgiveness
logic doesn't act on such iocgs. This can lead to unexpected behaviors - an
iocg with a little bit of debt will have its delay canceled through debt
forgiveness but one w/o any debt but active delay will have to wait out
until its delay decays out.

This patch updates the debt handling logic so that it treats delays the same
as debts. If either debt or delay is active, debt forgiveness logic kicks in
and acts on both the same way.

Also, avoid turning the debt and delay directly to zero as that can confuse
state transitions.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c