Commit 56c7426b3951e4f35a71d695f1c982989399d6fd
Committed by
Ingo Molnar
1 parent
b380b0d4f7
Exists in
master
and in
20 other branches
sched_clock: fix NOHZ interaction
If HLT stops the TSC, we'll fail to account idle time, thereby inflating the actual process times. Fix this by re-calibrating the clock against GTOD when leaving nohz mode. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Tested-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff
kernel/time/tick-sched.c
... | ... | @@ -162,6 +162,8 @@ |
162 | 162 | ts->idle_lastupdate = now; |
163 | 163 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); |
164 | 164 | ts->idle_active = 0; |
165 | + | |
166 | + sched_clock_idle_wakeup_event(0); | |
165 | 167 | } |
166 | 168 | } |
167 | 169 | |
... | ... | @@ -177,6 +179,7 @@ |
177 | 179 | } |
178 | 180 | ts->idle_entrytime = now; |
179 | 181 | ts->idle_active = 1; |
182 | + sched_clock_idle_sleep_event(); | |
180 | 183 | return now; |
181 | 184 | } |
182 | 185 |