Re: Efficient x86 and x86_64 NOP microbenchmarks

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <andi@...>, Thomas Gleixner <tglx@...>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...>, Linus Torvalds <torvalds@...>, Steven Rostedt <rostedt@...>, Jeremy Fitzhardinge <jeremy@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Peter Zijlstra <peterz@...>, Andrew Morton <akpm@...>, David Miller <davem@...>, Roland McGrath <roland@...>, Ulrich Drepper <drepper@...>, Rusty Russell <rusty@...>, Gregory Haskins <ghaskins@...>, Arnaldo Carvalho de Melo <acme@...>, Luis Claudio R. Goncalves <lclaudio@...>, Clark Williams <williams@...>
Date: Wednesday, August 13, 2008 - 4:00 pm

[
  Thanks to Mathieu Desnoyers who forward this to me. Currently my ISP 
for goodmis.org is having issues:
  https://help.domaindirect.com/index.php?_m=news&_a=viewnews&newsid=104
]

The problem is not ftrace noping out the call at runtime. The problem is 
ftrace changing the nops back to calls to mcount.

The nop part is simple, straight forward and not an issue that we are 
talking here. The issue is which kind of nop to use. The bug with the 
multi-part nop happens when we _enable_ tracing. That is, when someone 
runs the tracer. The issue with the multi-part nop is that a task could 
have been preempted after it executed the first nop and before the 
second part. Then we enable tracing, and when the task is scheduled back 
in, it now will execute half the call to the mcount function.

I want this point very clear. If you never run tracing, this bug will 
not happen. And the bug only happens on enabling the tracer, not on the 
disabling part. Not to mention that the bug itself will only happen 1 in 
a billion.


No, I can easily make a patch that does not use frame pointers but still 
uses -pg. We just can not print the parent function in the trace. This 
can easily be added to a config, as well as easily implemented.

I'm totally confused here.  How do you enable function tracing?  How do 
we make a call to the code that will trace a function was hit?


As I stated, the frame pointer part is only to record the parent 
function in tracing. ie:

             ls-4866  [00] 177596.041275: _spin_unlock <-journal_stop


Here we see that the function _spin_unlock was called by the function 
journal_stop. We can easily turn off parent tracing now, with:

# echo noprint-parent > /debug/tracing/iter_ctrl

which gives us just:

             ls-4866  [00] 177596.041275: _spin_unlock


If we disable frame pointers, the noprint-parent option would be forced. 
Not that devastating, but it gives the option to still have function 
tracing to the user without the requirement of having frame pointers.

I would still require that the irqsoff tracer add frame pointers, just 
because knowing that the long latency of interrupts disabled happened at 
local_irq_save doesn't cut it ;-)

Anyway, who would want to run with frame pointers disabled? If you ever 
get a bug crash, the stack trace is pretty much useless.

-- Steve

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Efficient x86 and x86_64 NOP microbenchmarks, Steven Rostedt, (Wed Aug 13, 4:00 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Andi Kleen, (Wed Aug 13, 4:15 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Steven Rostedt, (Wed Aug 13, 4:21 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Linus Torvalds, (Wed Aug 13, 4:21 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Jeremy Fitzhardinge, (Wed Aug 13, 4:06 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Steven Rostedt, (Wed Aug 13, 4:34 pm)