linux/block
David Wang bda9c7d92f block/genhd: use seq_put_decimal_ull for diskstats decimal values
seq_printf is costly. For each block device, 19 decimal values are
yielded in /proc/diskstats via seq_printf. On a system with 16 logical
block devices, profiling for open/read/close sequences shows seq_printf
took ~75% samples of diskstats_show:

	diskstats_show(92.626% 2269372/2450040)
	    seq_printf(76.026% 1725313/2269372)
		vsnprintf(99.163% 1710866/1725313)
		    format_decode(26.597% 455040/1710866)
		    number(19.554% 334542/1710866)
		    memcpy_orig(4.183% 71570/1710866)
			...
		srso_return_thunk(0.009% 148/1725313)
	    part_stat_read_all(8.030% 182236/2269372)

One million rounds of open/read/close /proc/diskstats takes:

	real	0m37.687s
	user	0m0.264s
	sys	0m32.911s
On average, each sequence tooks ~0.032ms

With this patch, most decimal values are yield via seq_put_decimal_ull,
performance is significantly improved:

	real	0m20.792s
	user	0m0.316s
	sys	0m20.463s
On average, each sequence tooks ~0.020ms, a ~37.5% improvement.

Signed-off-by: David Wang <00107082@163.com>
Link: https://lore.kernel.org/r/20241108054500.4251-1-00107082@163.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-11-13 14:02:19 -07:00
..
partitions block: add partition uuid into uevent as "PARTUUID" 2024-10-22 08:15:17 -06:00
badblocks.c
bdev.c for-6.12/block-20240925 2024-09-25 14:56:40 -07:00
bfq-cgroup.c block, bfq: merge bfq_release_process_ref() into bfq_put_cooperator() 2024-09-10 16:32:09 -06:00
bfq-iosched.c block, bfq: factor out a helper to split bfqq in bfq_init_rq() 2024-09-10 16:32:09 -06:00
bfq-iosched.h block, bfq: remove bfq_log_bfqg() 2024-09-10 16:32:09 -06:00
bfq-wf2q.c
bio-integrity.c blk-integrity: remove seed for user mapped buffers 2024-10-30 07:49:32 -06:00
bio.c block: Error an attempt to split an atomic write in bio_split() 2024-11-11 08:35:46 -07:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-ioprio: remove per-disk structure 2024-07-28 16:47:51 -06:00
blk-cgroup.h blk-cgroup: Remove unused declaration blkg_path() 2024-08-16 15:07:27 -06:00
blk-core.c block: add a rq_list type 2024-11-13 12:04:58 -07:00
blk-crypto-fallback.c block: Rework bio_split() return value 2024-11-11 08:35:46 -07:00
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c
blk-crypto.c
blk-flush.c for-6.11/block-20240710 2024-07-15 14:20:22 -07:00
blk-ia-ranges.c
blk-integrity.c blk-integrity: remove seed for user mapped buffers 2024-10-30 07:49:32 -06:00
blk-ioc.c block: replace call_rcu by kfree_rcu for simple kmem_cache_free callback 2024-10-22 08:16:40 -06:00
blk-iocost.c blk_iocost: remove some duplicate irq disable/enables 2024-10-02 07:15:43 -06:00
blk-iolatency.c
blk-ioprio.c blk-ioprio: remove per-disk structure 2024-07-28 16:47:51 -06:00
blk-ioprio.h blk-ioprio: remove per-disk structure 2024-07-28 16:47:51 -06:00
blk-lib.c block: fix detection of unsupported WRITE SAME in blkdev_issue_write_zeroes 2024-08-28 08:49:25 -06:00
blk-map.c
blk-merge.c block: add a rq_list type 2024-11-13 12:04:58 -07:00
blk-mq-cpumap.c
blk-mq-debugfs.c block: Catch possible entries missing from rqf_name[] 2024-07-19 09:32:49 -06:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c block: Fix lockdep warning in blk_mq_mark_tag_wait 2024-08-15 19:25:03 -06:00
blk-mq-virtio.c
blk-mq.c block: don't reorder requests in blk_add_rq_to_plug 2024-11-13 12:04:58 -07:00
blk-mq.h block: add a rq_list type 2024-11-13 12:04:58 -07:00
blk-pm.c
blk-pm.h
blk-rq-qos.c block: remove redundant explicit memory barrier from rq_qos waiter and waker 2024-10-22 14:05:09 -06:00
blk-rq-qos.h
blk-settings.c block: export blk_validate_limits 2024-11-13 11:40:11 -07:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: pre-calculate max_zone_append_sectors 2024-11-11 09:20:36 -07:00
blk-throttle.c block: flush all throttled bios when deleting the cgroup 2024-10-22 08:16:43 -06:00
blk-throttle.h blk-throttle: remove last_low_overflow_time 2024-09-10 16:31:41 -06:00
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: Add a public bdev_zone_is_seq() helper 2024-11-07 15:30:54 -07:00
blk.h block: lift bio_is_zone_append to bio.h 2024-11-11 09:06:45 -07:00
bounce.c
bsg-lib.c
bsg.c
disk-events.c
early-lookup.c
elevator.c block: don't verify IO lock for freeze/unfreeze in elevator_init_mq() 2024-11-07 16:27:22 -07:00
elevator.h block: return void from the queue_sysfs_entry load_module method 2024-10-22 08:16:22 -06:00
fops.c fs/block: Check for IOCB_DIRECT in generic_atomic_write_valid() 2024-10-19 16:48:22 -06:00
genhd.c block/genhd: use seq_put_decimal_ull for diskstats decimal values 2024-11-13 14:02:19 -07:00
holder.c
ioctl.c block: implement async io_uring discard cmd 2024-09-11 10:45:28 -06:00
ioprio.c
Kconfig
Kconfig.iosched
kyber-iosched.c
Makefile
mq-deadline.c
opal_proto.h
sed-opal.c block: sed-opal: add ioctl IOC_OPAL_SET_SID_PW 2024-10-22 08:16:40 -06:00
t10-pi.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00