summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2020-03-25 16:07:06 +0300
committerJens Axboe <axboe@kernel.dk>2020-03-25 08:49:10 -0600
commitea18e0f0a63af9064db3d4065d90fa743ae0991b (patch)
tree8956dcaaaebdac9d91317af6b5d53276c92bbeb0 /sound
parent2b8bd423614c595540eaadcfbc702afe8e155e50 (diff)
block/diskstats: accumulate all per-cpu counters in one pass
Reading /proc/diskstats iterates over all cpus for summing each field. It's faster to sum all fields in one pass. Hammering /proc/diskstats with fio shows 2x performance improvement: fio --name=test --numjobs=$JOBS --filename=/proc/diskstats \ --size=1k --bs=1k --fallocate=none --create_on_open=1 \ --time_based=1 --runtime=10 --invalidate=0 --group_report JOBS=1 JOBS=10 Before: 7k iops 64k iops After: 18k iops 120k iops Also this way code is more compact: add/remove: 1/0 grow/shrink: 0/2 up/down: 194/-1540 (-1346) Function old new delta part_stat_read_all - 194 +194 diskstats_show 1344 631 -713 part_stat_show 1219 392 -827 Total: Before=14966947, After=14965601, chg -0.01% Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'sound')
0 files changed, 0 insertions, 0 deletions