diff options
author | Tejun Heo <tj@kernel.org> | 2020-09-01 20:52:37 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-02 03:38:31 +0200 |
commit | 7b84b49e381a8538626f200785dd918a402c62d7 (patch) | |
tree | d6a7de2c2d73d3744835b910d822af19697b1be6 /block/blk-iocost.c | |
parent | blk-iocost: move iocg_kick_delay() above iocg_kick_waitq() (diff) | |
download | linux-7b84b49e381a8538626f200785dd918a402c62d7.tar.xz linux-7b84b49e381a8538626f200785dd918a402c62d7.zip |
blk-iocost: make iocg_kick_waitq() call iocg_kick_delay() after paying debt
iocg_kick_waitq() is the function which pays debt and iocg_kick_delay()
updates the actual delay status accordingly. If iocg_kick_delay() is not
called after iocg_kick_delay() updated debt, unnecessarily large delays can
be applied temporarily.
Let's make sure such conditions don't occur by making iocg_kick_waitq()
always call iocg_kick_delay() after paying debt.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-iocost.c')
-rw-r--r-- | block/blk-iocost.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index ac22d761a350..b2b8dfbeee5a 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1226,6 +1226,8 @@ static void iocg_kick_waitq(struct ioc_gq *iocg, struct ioc_now *now) atomic64_add(delta, &iocg->vtime); atomic64_add(delta, &iocg->done_vtime); iocg->abs_vdebt -= abs_delta; + + iocg_kick_delay(iocg, now); } /* @@ -1383,7 +1385,6 @@ static void ioc_timer_fn(struct timer_list *timer) if (waitqueue_active(&iocg->waitq) || iocg->abs_vdebt) { /* might be oversleeping vtime / hweight changes, kick */ iocg_kick_waitq(iocg, &now); - iocg_kick_delay(iocg, &now); } else if (iocg_is_idle(iocg)) { /* no waiter and idle, deactivate */ iocg->last_inuse = iocg->inuse; |