diff options
| author | Frederic Weisbecker <frederic@kernel.org> | 2026-05-08 15:16:47 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-06-02 21:27:26 +0200 |
| commit | 6199f9999a9b62b2b84a1bf5b52a9fd0bb8de5af (patch) | |
| tree | 94f89d7634ee9a95d4fd196becc23a9946ae900c /include/linux | |
| parent | 7198e3927a14535475a24cce559f41f97e6c0b66 (diff) | |
sched/cputime: Handle dyntick-idle steal time correctlyrefs/merge-window/a491e1430a4fbfab275a200b4acfa057f0aab44d
The dyntick-idle steal time is currently accounted when the tick restarts
but the stolen idle time is not subtracted from the idle time that was
already accounted. This is to avoid observing the idle time going backward
as the dyntick-idle cputime accessors can't reliably know in advance the
stolen idle time.
In order to maintain a forward progressing idle cputime while subtracting
idle steal time from it, keep track of the previously accounted idle stolen
time and substract it from _later_ idle cputime accounting.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Link: https://patch.msgid.link/20260508131647.43868-16-frederic@kernel.org
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kernel_stat.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 512104b0ff49..fce1392e2140 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -39,6 +39,7 @@ struct kernel_cpustat { bool idle_elapse; seqcount_t idle_sleeptime_seq; u64 idle_entrytime; + u64 idle_stealtime[2]; #endif u64 cpustat[NR_STATS]; }; |
