]> granicus.if.org Git - sysstat/commit
Workaround for iowait being decremented
authorPetr Pavlu <petr.pavlu@suse.com>
Wed, 2 Sep 2020 08:24:43 +0000 (10:24 +0200)
committerPetr Pavlu <petr.pavlu@suse.com>
Wed, 2 Sep 2020 12:07:21 +0000 (14:07 +0200)
commit6ab627493544c685823f63b74636e82981d96ea8
treea735f7f38c31f72d828769e2c68b5377a5947857
parent8a797054173954b57cfa23d9e6885adad5ab73d2
Workaround for iowait being decremented

The iowait value reported by the kernel on NO_HZ systems can decrement
as a result of inaccurate iowait tracking. Waiting on IO can be first
accounted as iowait but then instead as idle.

Function get_per_cpu_interval() considers iowait going backwards between
two readings as a CPU coming back online and resets the iowait value of
the first reading to 0. If iowait is decremented only because of
inaccurate tracking, this causes that almost all time between the two
readings is incorrectly recognized by sar as being spent in iowait.

The patch updates the code in get_per_cpu_interval() to recognize this
situation. If the iowait value between two readings decremented but the
idle value did not then the code now considers it as a problem with the
iowait reporting and corrects the first value according to the second
reading. Otherwise, the code remains treating decremented iowait as a
CPU coming back online.

Fixes #14.
42 files changed:
rd_stats.c
tests/expected.data-ini
tests/expected.iostat
tests/expected.iostat-ALL
tests/expected.iostat-gpy
tests/expected.iostat-list
tests/expected.iostat-p-sda
tests/expected.iostat-sigint
tests/expected.iostat-x-ALL-flush
tests/expected.iostat-xs
tests/expected.iostat-xs-list-part
tests/expected.iostat-ym
tests/expected.mpstat-A
tests/expected.mpstat-T
tests/expected.sa1
tests/expected.sa2
tests/expected.sadf-d
tests/expected.sadf-d-qu
tests/expected.sadf-g
tests/expected.sadf-g-cc
tests/expected.sadf-j
tests/expected.sadf-p
tests/expected.sadf-r
tests/expected.sadf-x
tests/expected.sar-D
tests/expected.sar-ISO
tests/expected.sar-all
tests/expected.sar-always
tests/expected.sar-autonever
tests/expected.sar-human
tests/expected.sar-i
tests/expected.sar-se
tests/expected.sar-u
tests/expected.sar1
tests/expected2.sadf-g
tests/expected2.sar-all
tests/expected2.sar-u
tests/expected3.sadf-g
tests/expected3.sar-i
tests/expected33.sar-u
tests/root.README
tests/root3/proc/stat