aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-03-22 04:20:24 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-03-26 03:28:55 -0400
commit06d8308c61e54346585b2691c13ee3f90cb6fb2f (patch)
treed522e285525964706e7ec112bca23d407a540a8e /include/linux
parent898a19de1502649877091b398229026b4142c0e2 (diff)
NOHZ: reevaluate idle sleep length after add_timer_on()
add_timer_on() can add a timer on a CPU which is currently in a long idle sleep, but the timer wheel is not reevaluated by the nohz code on that CPU. So a timer can be delayed for quite a long time. This triggered a false positive in the clocksource watchdog code. To avoid this we need to wake up the idle CPU and enforce the reevaluation of the timer wheel for the next timer event. Add a function, which checks a given CPU for idle state, marks the idle task with NEED_RESCHED and sends a reschedule IPI to notify the other CPU of the change in the timer wheel. Call this function from add_timer_on(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: stable@kernel.org -- include/linux/sched.h | 6 ++++++ kernel/sched.c | 43 +++++++++++++++++++++++++++++++++++++++++++ kernel/timer.c | 10 +++++++++- 3 files changed, 58 insertions(+), 1 deletion(-)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index fed07d03364e..6a1e7afb099b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1541,6 +1541,12 @@ static inline void idle_task_exit(void) {}
1541 1541
1542extern void sched_idle_next(void); 1542extern void sched_idle_next(void);
1543 1543
1544#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
1545extern void wake_up_idle_cpu(int cpu);
1546#else
1547static inline void wake_up_idle_cpu(int cpu) { }
1548#endif
1549
1544#ifdef CONFIG_SCHED_DEBUG 1550#ifdef CONFIG_SCHED_DEBUG
1545extern unsigned int sysctl_sched_latency; 1551extern unsigned int sysctl_sched_latency;
1546extern unsigned int sysctl_sched_min_granularity; 1552extern unsigned int sysctl_sched_min_granularity;