Patchwork [1/7] ftrace, PPC: do not latency trace idle

login
register
mail settings
Submitter Steven Rostedt
Date Nov. 16, 2008, 9:24 p.m.
Message ID <20081116212515.093117788@goodmis.org>
Download mbox | patch
Permalink /patch/9022/
State Accepted
Commit 6d07bb47354174a9b52d3b03f9e38b069a93d341
Headers show

Comments

Steven Rostedt - Nov. 16, 2008, 9:24 p.m.
Impact: give better timing to latency tracers

When idle is called, interrupts are disabled, but the idle function
will still wake up on an interrupt. The problem is that the interrupt
disabled latency tracer will take this call to idle as a latency.

This patch disables the latency tracing when going into idle.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
CC:  Paul Mackerras <paulus@samba.org>
CC:  Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/idle.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Paul Mackerras - Nov. 17, 2008, 3:43 a.m.
Steven Rostedt writes:

> When idle is called, interrupts are disabled, but the idle function
> will still wake up on an interrupt. The problem is that the interrupt
> disabled latency tracer will take this call to idle as a latency.
> 
> This patch disables the latency tracing when going into idle.

Patch looks OK, but what is the connection with ftrace?

Paul.
Steven Rostedt - Nov. 17, 2008, 3:43 p.m.
On Mon, 17 Nov 2008, Paul Mackerras wrote:

> Steven Rostedt writes:
> 
> > When idle is called, interrupts are disabled, but the idle function
> > will still wake up on an interrupt. The problem is that the interrupt
> > disabled latency tracer will take this call to idle as a latency.
> > 
> > This patch disables the latency tracing when going into idle.
> 
> Patch looks OK, but what is the connection with ftrace?

Ah, that patch has been sitting on my box for some time. It has to deal 
with the latency tracer and not the dynamic tracing part of ftrace. I 
added it because it is PPC ftrace related and to get it off my box. But 
this is not have anything to do with the rest of the patches.

-- Steve

Patch

diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 31982d0..88d9c1d 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -69,10 +69,15 @@  void cpu_idle(void)
 				smp_mb();
 				local_irq_disable();
 
+				/* Don't trace irqs off for idle */
+				stop_critical_timings();
+
 				/* check again after disabling irqs */
 				if (!need_resched() && !cpu_should_die())
 					ppc_md.power_save();
 
+				start_critical_timings();
+
 				local_irq_enable();
 				set_thread_flag(TIF_POLLING_NRFLAG);