• Tejun Heo's avatar
    blk-iocost: calculate iocg->usages[] from iocg->local_stat.usage_us · 1aa50d02
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    1aa50d02
iocost.h 4.83 KB