]> 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)
commitccf9ba67df884e9e4a56a54283283103d11138f0
tree47b92042284fe130d6a31b3e92b0091542fa508d
parentb636f2dea94c69ec8f1b9c653223553c1b633c17
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