diff options
author | Frederic Weisbecker <frederic@kernel.org> | 2023-02-22 17:46:44 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2023-04-18 17:35:12 +0300 |
commit | 620a30fa0bd14878891b22bf2261e6ed4587c2b4 (patch) | |
tree | 9d193dac68bacb68e34c573819d7c570c96dbc6b /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 07b65a800b6d5b6afbd6a91487b47038eac97c21 (diff) | |
download | linux-620a30fa0bd14878891b22bf2261e6ed4587c2b4.tar.xz |
timers/nohz: Protect idle/iowait sleep time under seqcount
Reading idle/IO sleep time (eg: from /proc/stat) can race with idle exit
updates because the state machine handling the stats is not atomic and
requires a coherent read batch.
As a result reading the sleep time may report irrelevant or backward
values.
Fix this with protecting the simple state machine within a seqcount.
This is expected to be cheap enough not to add measurable performance
impact on the idle path.
Note this only fixes reader VS writer condition partitially. A race
remains that involves remote updates of the CPU iowait task counter. It
can hardly be fixed.
Reported-by: Yu Liao <liaoyu15@huawei.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230222144649.624380-4-frederic@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions