summaryrefslogtreecommitdiffstats
path: root/kernel/sched/idle.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2015-07-20 12:34:50 -0400
committerIngo Molnar <mingo@kernel.org>2015-07-21 02:18:51 -0400
commit63caae8480921773b46adec0b6ddac9a844a042f (patch)
treef1bfb0d5537fc05a021aeb17532775b17f7cdb1f /kernel/sched/idle.c
parent399595f248cb25dccb6044b53c47c44c174dc23d (diff)
sched/idle: Move latency tracing stop/start calls deeper inside the idle loop
Make sure to stop tracing only once we are past a point where all latency tracing events have been processed (irqs are not enabled again). This has the slight advantage of capturing more latency related events in the idle path, but most importantly it makes sure that latency tracing doesn't get re-enabled inadvertently when new events are coming in. This makes the irqsoff latency tracer useful again, as we stop capturing CPU sleep time as IRQ latency. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kernel@pengutronix.de Cc: patchwork-lst@pengutronix.de Link: http://lkml.kernel.org/r/1437410090-3747-1-git-send-email-l.stach@pengutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/idle.c')
-rw-r--r--kernel/sched/idle.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 594275ed2620..8f177c73ae19 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -83,10 +83,13 @@ void __weak arch_cpu_idle(void)
83 */ 83 */
84void default_idle_call(void) 84void default_idle_call(void)
85{ 85{
86 if (current_clr_polling_and_test()) 86 if (current_clr_polling_and_test()) {
87 local_irq_enable(); 87 local_irq_enable();
88 else 88 } else {
89 stop_critical_timings();
89 arch_cpu_idle(); 90 arch_cpu_idle();
91 start_critical_timings();
92 }
90} 93}
91 94
92static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev, 95static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
@@ -141,12 +144,6 @@ static void cpuidle_idle_call(void)
141 } 144 }
142 145
143 /* 146 /*
144 * During the idle period, stop measuring the disabled irqs
145 * critical sections latencies
146 */
147 stop_critical_timings();
148
149 /*
150 * Tell the RCU framework we are entering an idle section, 147 * Tell the RCU framework we are entering an idle section,
151 * so no more rcu read side critical sections and one more 148 * so no more rcu read side critical sections and one more
152 * step to the grace period 149 * step to the grace period
@@ -198,7 +195,6 @@ exit_idle:
198 local_irq_enable(); 195 local_irq_enable();
199 196
200 rcu_idle_exit(); 197 rcu_idle_exit();
201 start_critical_timings();
202} 198}
203 199
204DEFINE_PER_CPU(bool, cpu_dead_idle); 200DEFINE_PER_CPU(bool, cpu_dead_idle);