Commit 56c7426b authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b380b0d4
...@@ -162,6 +162,8 @@ void tick_nohz_stop_idle(int cpu) ...@@ -162,6 +162,8 @@ void tick_nohz_stop_idle(int cpu)
ts->idle_lastupdate = now; ts->idle_lastupdate = now;
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
ts->idle_active = 0; 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) ...@@ -177,6 +179,7 @@ static ktime_t tick_nohz_start_idle(struct tick_sched *ts)
} }
ts->idle_entrytime = now; ts->idle_entrytime = now;
ts->idle_active = 1; ts->idle_active = 1;
sched_clock_idle_sleep_event();
return now; return now;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment