• Z
    block: add a switch for precise iostat accounting · 69e55430
    Zhang Wensheng 提交于
    hulk inclusion
    category: bugfix
    bugzilla: 39265, https://gitee.com/openeuler/kernel/issues/I4WC06
    CVE: NA
    
    -----------------------------------------------
    
    When the inflight IOs are slow and no new IOs are issued, we expect
    iostat could manifest the IO hang problem. However after
    commit 9c6dea45 ("block: delete part_round_stats and switch to less
    precise counting"), io_tick and time_in_queue will not be updated until
    the end of IO, and the avgqu-sz and %util columns of iostat will be zero.
    
    To fix it, we could fallback to the implementation before commit
    9c6dea45, but it may cause performance regression on NVMe device
    or bio-based device (due to overhead of inflight calculation),
    so add a switch to control whether or not to use precise iostat
    accounting. It can be enabled by adding "precise_iostat=1" in kernel
    boot cmdline. When precise accouting is enabled, io_tick and time_in_queue
    will be updated when accessing /proc/diskstats and
    /sys/block/sdX/sdXN/stat.
    
    Fixes: 9c6dea45 ("block: delete part_round_stats and switch to less precise counting")
    Signed-off-by: NZhang Wensheng <zhangwensheng5@huawei.com>
    Reviewed-by: NJason Yan <yanaijie@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    69e55430
blkdev.h 62.0 KB