sched_clock: fix NOHZ interaction

Previous thread: x86: add io delay quirk for Presario F700 by Linux Kernel Mailing List on Friday, September 5, 2008 - 7:05 pm. (1 message)

Next thread: sched: fix process time monotonicity by Linux Kernel Mailing List on Friday, September 5, 2008 - 7:05 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, September 5, 2008 - 7:05 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56c742...
Commit:     56c7426b3951e4f35a71d695f1c982989399d6fd
Parent:     b380b0d4f7dffcc235c0facefa537d4655619101
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Mon Sep 1 16:44:23 2008 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri Sep 5 18:14:08 2008 +0200

    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>
---
 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 7a46bde..a87b046 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;
 }
 
--

Previous thread: x86: add io delay quirk for Presario F700 by Linux Kernel Mailing List on Friday, September 5, 2008 - 7:05 pm. (1 message)

Next thread: sched: fix process time monotonicity by Linux Kernel Mailing List on Friday, September 5, 2008 - 7:05 pm. (1 message)