Konstantin Khlebnikov
ea18e0f0a6
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>
2020-03-25 08:49:10 -06:00
..
2020-03-24 07:57:08 -06:00
2019-04-30 16:11:57 -06:00
2020-03-21 14:31:03 -06:00
2020-03-21 14:31:00 -06:00
2020-03-21 14:31:00 -06:00
2020-02-03 06:58:15 -07:00
2019-12-05 11:38:36 -07:00
2020-03-25 08:49:08 -06:00
2019-11-07 12:28:13 -07:00
2019-11-07 12:28:13 -07:00
2019-12-12 09:26:55 -07:00
2020-03-25 08:49:08 -06:00
2019-10-10 17:52:31 -06:00
2020-03-12 07:42:54 -06:00
2019-09-17 20:03:49 -06:00
2020-03-12 07:07:38 -06:00
2020-03-12 08:02:20 -06:00
2019-08-28 21:17:08 -06:00
2018-11-14 08:17:18 -07:00
2019-12-20 11:52:01 -07:00
2020-01-14 13:37:40 -07:00
2019-08-04 21:43:12 -06:00
2019-01-17 21:21:40 -07:00
2019-07-09 10:45:06 -07:00
2019-06-13 03:00:30 -06:00
2019-05-31 15:12:34 -06:00
2019-05-31 15:12:34 -06:00
2020-02-24 18:50:48 -07:00
2019-07-23 07:25:09 -06:00
2019-11-04 07:14:10 -07:00
2020-02-26 10:34:41 -07:00
2020-02-26 10:34:41 -07:00
2019-05-31 15:12:34 -06:00
2020-03-12 07:42:54 -06:00
2020-02-26 10:34:41 -07:00
2019-09-12 07:11:56 -06:00
2018-11-15 12:17:28 -07:00
2019-10-06 09:26:41 -06:00
2019-10-15 10:13:13 -06:00
2020-01-15 21:43:09 -07:00
2019-11-18 07:29:22 -07:00
2019-10-07 21:19:10 -06:00
2018-12-12 06:47:51 -07:00
2019-10-07 08:31:59 -06:00
2019-11-07 12:28:13 -07:00
2019-04-30 16:12:03 -06:00
2019-10-06 09:26:41 -06:00
2019-08-28 21:17:07 -06:00
2020-03-12 09:10:52 -06:00
2020-03-24 07:57:07 -06:00
2019-04-30 09:26:13 -06:00
2019-12-20 11:52:01 -07:00
2020-01-03 09:33:21 +01:00
2017-11-02 11:10:55 +01:00
2019-11-07 12:27:19 -07:00
2020-03-25 08:49:10 -06:00
2020-01-03 09:42:52 +01:00
2019-07-15 09:20:27 -03:00
2020-01-06 20:59:04 -07:00
2019-11-07 12:28:13 -07:00
2019-07-02 21:03:27 -06:00
2020-03-24 07:57:08 -06:00
2019-09-05 19:52:33 -06:00
2020-03-12 08:00:10 -06:00
2020-01-03 09:33:05 +01:00
2020-03-12 08:00:10 -06:00
2020-01-06 20:59:04 -07:00