• T
    blk-iocost: account for IO size when testing latencies · 8c8fb141
    Tejun Heo 提交于
    to #29361128
    
    commit cd006509b0a93cb7ee9d9fd50ae274098997a460 upstream.
    
    On each IO completion, iocost decides whether the IO met or missed its latency
    target. Currently, the targets are fixed numbers per IO type. While this can be
    good enough for loose latency targets way higher than typical completion
    latencies, the effect of IO size makes it difficult to tighten the latency
    target - a target adequate for 4k IOs might be too tight for 512k IOs and
    vice-versa.
    
    iocost already has all the necessary information to account for different IO
    sizes when testing whether the latency target is met as iocost can calculate the
    size vtime cost of a given IO. This patch updates the completion path to
    calculate the size vtime cost of the IO, deduct the nsec equivalent from the
    observed latency and use the adjusted value to decide whether the target is met.
    
    This makes latency targets independent from IO size and enables determining
    adequate latency targets with fixed size fio runs.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    Cc: Andy Newell <newella@fb.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    Signed-off-by: NJiufei Xue <jiufei.xue@linux.alibaba.com>
    Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    8c8fb141
blk-iocost.c 70.6 KB