• M
    block: delete part_round_stats and switch to less precise counting · 9c6dea45
    Mikulas Patocka 提交于
    mainline inclusion
    from mainline-5.0-rc1
    commit 5b18b5a737600fd20ba2045f320d5926ebbf341a
    category: bugfix
    bugzilla: 31388
    CVE: NA
    ---------------------------
    
    We want to convert to per-cpu in_flight counters.
    
    The function part_round_stats needs the in_flight counter every jiffy, it
    would be too costly to sum all the percpu variables every jiffy, so it
    must be deleted. part_round_stats is used to calculate two counters -
    time_in_queue and io_ticks.
    
    time_in_queue can be calculated without part_round_stats, by adding the
    duration of the I/O when the I/O ends (the value is almost as exact as the
    previously calculated value, except that time for in-progress I/Os is not
    counted).
    
    io_ticks can be approximated by increasing the value when I/O is started
    or ended and the jiffies value has changed. If the I/Os take less than a
    jiffy, the value is as exact as the previously calculated value. If the
    I/Os take more than a jiffy, io_ticks can drift behind the previously
    calculated value.
    Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: NMike Snitzer <snitzer@redhat.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    Conflict:
    	block/bio.c
    	block/blk-core.c
    	block/blk-merge.c
    	block/genhd.c
    	include/linux/genhd.h
    Signed-off-by: NYufen Yu <yuyufen@huawei.com>
    Reviewed-by: NHou Tao <houtao1@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    9c6dea45
genhd.h 23.9 KB