]> git.baikalelectronics.ru Git - kernel.git/commit
blk-iocost: calculate iocg->usages[] from iocg->local_stat.usage_us
authorTejun Heo <tj@kernel.org>
Tue, 1 Sep 2020 18:52:44 +0000 (14:52 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Sep 2020 01:38:32 +0000 (19:38 -0600)
commit040d1500970f20458b175d5702937069977d7263
tree47b92042284fe130d6a31b3e92b0091542fa508d
parent55750b95c3ad05e91c0218e5dd935498c84736df
blk-iocost: calculate iocg->usages[] from iocg->local_stat.usage_us

Currently, iocg->usages[] which are used to guide inuse adjustments are
calculated from vtime deltas. This, however, assumes that the hierarchical
inuse weight at the time of calculation held for the entire period, which
often isn't true and can lead to significant errors.

Now that we have absolute usage information collected, we can derive
iocg->usages[] from iocg->local_stat.usage_us so that inuse adjustment
decisions are made based on actual absolute usage. The calculated usage is
clamped between 1 and WEIGHT_ONE and WEIGHT_ONE is also used to signal
saturation regardless of the current hierarchical inuse weight.

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