diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-09-01 16:44:23 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-05 18:14:08 +0200 |
commit | 56c7426b3951e4f35a71d695f1c982989399d6fd (patch) | |
tree | 26001a24308baceab1ff36eb8ab1ed43fb831a4f | |
parent | forgotten refcount on sysctl root table (diff) | |
download | linux-56c7426b3951e4f35a71d695f1c982989399d6fd.tar.xz linux-56c7426b3951e4f35a71d695f1c982989399d6fd.zip |
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>
-rw-r--r-- | kernel/time/tick-sched.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 7a46bde78c66..a87b0468568b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -162,6 +162,8 @@ void tick_nohz_stop_idle(int cpu) ts->idle_lastupdate = now; ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); ts->idle_active = 0; + + sched_clock_idle_wakeup_event(0); } } @@ -177,6 +179,7 @@ static ktime_t tick_nohz_start_idle(struct tick_sched *ts) } ts->idle_entrytime = now; ts->idle_active = 1; + sched_clock_idle_sleep_event(); return now; } |