diff options
author | Frederic Weisbecker <[email protected]> | 2023-02-22 15:46:44 +0100 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2023-04-18 16:35:12 +0200 |
commit | 620a30fa0bd14878891b22bf2261e6ed4587c2b4 (patch) | |
tree | 9d193dac68bacb68e34c573819d7c570c96dbc6b /lib/memory-notifier-error-inject.c | |
parent | 07b65a800b6d5b6afbd6a91487b47038eac97c21 (diff) |
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 <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions