diff options
author | Tejun Heo | 2020-09-17 20:44:56 -0400 |
---|---|---|
committer | Jens Axboe | 2020-09-25 08:35:02 -0600 |
commit | c5a6561b8d99ea7d8df21308249ce05bce3dd466 (patch) | |
tree | 375d70f7fd4bfcee50cf07ea43735fbd98611d62 /block | |
parent | c7af2a003a411853fc9c805efe96d10dcc8adb5f (diff) |
iocost: add iocg_forgive_debt tracepoint
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-iocost.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 9b1f94499432..328ae805e85f 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -2046,12 +2046,24 @@ static void ioc_forgive_debts(struct ioc *ioc, u64 usage_us_sum, int nr_debtors, ioc->dfgv_period_rem = do_div(nr_cycles, DFGV_PERIOD); list_for_each_entry(iocg, &ioc->active_iocgs, active_list) { + u64 __maybe_unused old_debt, __maybe_unused old_delay; + if (!iocg->abs_vdebt) continue; + spin_lock(&iocg->waitq.lock); + + old_debt = iocg->abs_vdebt; + old_delay = iocg->delay; + iocg->abs_vdebt >>= nr_cycles; iocg->delay = 0; /* kick_waitq will recalc */ iocg_kick_waitq(iocg, true, now); + + TRACE_IOCG_PATH(iocg_forgive_debt, iocg, now, usage_pct, + old_debt, iocg->abs_vdebt, + old_delay, iocg->delay); + spin_unlock(&iocg->waitq.lock); } } |