aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-07-07 14:16:52 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-11 09:53:26 -0400
commitaf52a90a14cdaa54ecbfb6e6982abb13466a4b56 (patch)
tree2488d6d7943b167987c33f984f7109c3dc4ae783 /include/linux/sched.h
parentf7cce27f5605b9e137b829a47949cb2d3c7e1cab (diff)
sched_clock: stop maximum check on NO HZ
Working with ftrace I would get large jumps of 11 millisecs or more with the clock tracer. This killed the latencing timings of ftrace and also caused the irqoff self tests to fail. What was happening is with NO_HZ the idle would stop the jiffy counter and before the jiffy counter was updated the sched_clock would have a bad delta jiffies to compare with the gtod with the maximum. The jiffies would stop and the last sched_tick would record the last gtod. On wakeup, the sched clock update would compare the gtod + delta jiffies (which would be zero) and compare it to the TSC. The TSC would have correctly (with a stable TSC) moved forward several jiffies. But because the jiffies has not been updated yet the clock would be prevented from moving forward because it would appear that the TSC jumped too far ahead. The clock would then virtually stop, until the jiffies are updated. Then the next sched clock update would see that the clock was very much behind since the delta jiffies is now correct. This would then jump the clock forward by several jiffies. This caused ftrace to report several milliseconds of interrupts off latency at every resume from NO_HZ idle. This patch adds hooks into the nohz code to disable the checking of the maximum clock update when nohz is in effect. It resumes the max check when nohz has updated the jiffies again. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Cc: Steven Rostedt <srostedt@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c5d3f847ca8d..33a8f42041fa 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1573,13 +1573,28 @@ static inline void sched_clock_idle_sleep_event(void)
1573static inline void sched_clock_idle_wakeup_event(u64 delta_ns) 1573static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1574{ 1574{
1575} 1575}
1576#else 1576
1577#ifdef CONFIG_NO_HZ
1578static inline void sched_clock_tick_stop(int cpu)
1579{
1580}
1581
1582static inline void sched_clock_tick_start(int cpu)
1583{
1584}
1585#endif
1586
1587#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1577extern void sched_clock_init(void); 1588extern void sched_clock_init(void);
1578extern u64 sched_clock_cpu(int cpu); 1589extern u64 sched_clock_cpu(int cpu);
1579extern void sched_clock_tick(void); 1590extern void sched_clock_tick(void);
1580extern void sched_clock_idle_sleep_event(void); 1591extern void sched_clock_idle_sleep_event(void);
1581extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1592extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1593#ifdef CONFIG_NO_HZ
1594extern void sched_clock_tick_stop(int cpu);
1595extern void sched_clock_tick_start(int cpu);
1582#endif 1596#endif
1597#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1583 1598
1584/* 1599/*
1585 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu 1600 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu