• T
    iocost: improve nr_lagging handling · f63e7224
    Tejun Heo 提交于
    commit 7cd806a9a953f234b9865c30028f47fd738ce375 upstream.
    
    Some IOs may span multiple periods.  As latencies are collected on
    completion, the inbetween periods won't register them and may
    incorrectly decide to increase vrate.  nr_lagging tracks these IOs to
    avoid those situations.  Currently, whenever there are IOs which are
    spanning from the previous period, busy_level is reset to 0 if
    negative thus suppressing vrate increase.
    
    This has the following two problems.
    
    * When latency target percentiles aren't set, vrate adjustment should
      only be governed by queue depth depletion; however, the current code
      keeps nr_lagging active which pulls in latency results and can keep
      down vrate unexpectedly.
    
    * When lagging condition is detected, it resets the entire negative
      busy_level.  This turned out to be way too aggressive on some
      devices which sometimes experience extended latencies on a small
      subset of commands.  In addition, a lagging IO will be accounted as
      latency target miss on completion anyway and resetting busy_level
      amplifies its impact unnecessarily.
    
    This patch fixes the above two problems by disabling nr_lagging
    counting when latency target percentiles aren't set and blocking vrate
    increases when there are lagging IOs while leaving busy_level as-is.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    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>
    f63e7224
blk-iocost.c 68.1 KB