linux/block
Yu Kuai 7be835694d block: fix that util can be greater than 100%
util means the percentage that disk has IO, and theoretically it should
not be greater than 100%. However, there is a gap for rq-based disk:

io_ticks will be updated when rq is allocated, however, before such rq
dispatch to driver, it will not be account as inflight from
blk_mq_start_request() hence diskstats_show()/part_stat_show() will not
update io_ticks. For example:

1) at t0, issue a new IO, rq is allocated, and blk_account_io_start()
update io_ticks;

2) something is wrong with drivers, and the rq can't be dispatched;

3) at t0 + 10s, drivers recovers and rq is dispatched and done, io_ticks
is updated;

Then if user is using "iostat 1" to monitor "util", between t0 - t0+9s,
util will be zero, and between t0+9s - t0+10s, util will be 1000%.

Fix this problem by updating io_ticks from diskstats_show() and
part_stat_show() if there are rq allocated.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240509123717.3223892-3-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-05-09 07:59:44 -06:00
..
partitions block: fix and simplify blkdevparts= cmdline parsing 2024-05-03 09:57:53 -06:00
badblocks.c
bdev.c fs,block: get holder during claim 2024-03-18 10:32:44 +01:00
bfq-cgroup.c block: add blk_time_get_ns() and blk_time_get() helpers 2024-02-05 10:07:22 -07:00
bfq-iosched.c block: add blk_time_get_ns() and blk_time_get() helpers 2024-02-05 10:07:22 -07:00
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c block: support PI at non-zero offset within metadata 2024-02-12 08:49:31 -07:00
bio.c block: add a bio_await_chain helper 2024-05-07 07:29:42 -06:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c blk-cgroup: use group allocation/free of per-cpu counters API 2024-04-03 09:10:17 -06:00
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: use bio_list_merge_init 2024-04-01 11:53:37 -06:00
blk-cgroup.h block: move cgroup time handling code into blk.h 2024-02-05 10:07:17 -07:00
blk-core.c block: support to account io_ticks precisely 2024-05-09 07:59:44 -06:00
blk-crypto-fallback.c block, fs: Restore the per-bio/request data lifetime fields 2024-02-06 14:31:05 +01:00
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c
blk-crypto.c
blk-flush.c block: Fix flush request sector restore 2024-05-01 08:08:43 -06:00
blk-ia-ranges.c
blk-integrity.c block: support PI at non-zero offset within metadata 2024-02-12 08:49:31 -07:00
blk-ioc.c
blk-iocost.c for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
blk-iolatency.c block: add blk_time_get_ns() and blk_time_get() helpers 2024-02-05 10:07:22 -07:00
blk-ioprio.c
blk-ioprio.h
blk-lib.c block: add a blk_alloc_discard_bio helper 2024-05-07 07:29:42 -06:00
blk-map.c block: Fix WARNING in _copy_from_iter 2024-01-23 08:56:55 -07:00
blk-merge.c block: support to account io_ticks precisely 2024-05-09 07:59:44 -06:00
blk-mq-cpumap.c
blk-mq-debugfs.c block: Remove zone write locking 2024-04-17 08:44:03 -06:00
blk-mq-debugfs.h block: Replace zone_wlock debugfs entry with zone_wplugs entry 2024-04-17 08:44:03 -06:00
blk-mq-pci.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-virtio.c
blk-mq.c block: support to account io_ticks precisely 2024-05-09 07:59:44 -06:00
blk-mq.h block: Do not special-case plugging of zone write operations 2024-04-17 08:44:03 -06:00
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c block: Remove elevator required features 2024-04-17 08:44:03 -06:00
blk-stat.c block: prevent division by zero in blk_rq_stat_sum() 2024-03-06 08:31:54 -07:00
blk-stat.h
blk-sysfs.c block: Allow zero value of max_zone_append_sectors queue limit 2024-04-17 08:44:03 -06:00
blk-throttle.c blk-throttle: Only use seq_printf() in tg_prfill_limit() 2024-04-01 11:53:37 -06:00
blk-throttle.h
blk-timeout.c
blk-wbt.c for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
blk-wbt.h
blk-zoned.c block: Cleanup blk_revalidate_zone_cb() 2024-05-01 08:08:43 -06:00
blk.h block: support to account io_ticks precisely 2024-05-09 07:59:44 -06:00
bounce.c block, fs: Restore the per-bio/request data lifetime fields 2024-02-06 14:31:05 +01:00
bsg-lib.c block: pass a queue_limits argument to blk_mq_init_queue 2024-02-13 08:56:59 -07:00
bsg.c
disk-events.c
early-lookup.c
elevator.c block: Remove elevator required features 2024-04-17 08:44:03 -06:00
elevator.h block: Remove elevator required features 2024-04-17 08:44:03 -06:00
fops.c block: refine the EOF check in blkdev_iomap_begin 2024-05-03 09:05:11 -06:00
genhd.c block: fix that util can be greater than 100% 2024-05-09 07:59:44 -06:00
holder.c block: fix deadlock between bd_link_disk_holder and partition scan 2024-02-23 07:44:19 -07:00
ioctl.c blk-lib: check for kill signal in ioctl BLKDISCARD 2024-05-07 07:29:42 -06:00
ioprio.c
Kconfig block: Do not force select mq-deadline with CONFIG_BLK_DEV_ZONED 2024-04-17 08:44:03 -06:00
Kconfig.iosched
kyber-iosched.c
Makefile block: Move zone related debugfs attribute to blk-zoned.c 2024-04-17 08:44:03 -06:00
mq-deadline.c block/mq-deadline: Remove some unused functions 2024-04-19 08:10:36 -06:00
opal_proto.h block: sed-opal: handle empty atoms when parsing response 2024-02-16 15:52:45 -07:00
sed-opal.c for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
t10-pi.c block: support PI at non-zero offset within metadata 2024-02-12 08:49:31 -07:00