From: Steven Rostedt <rostedt@goodmis.org>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: 2.6.33: ftrace triggers soft lockup
Date: Fri, 05 Mar 2010 10:06:43 -0500 [thread overview]
Message-ID: <1267801603.10871.1725.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <2375c9f91003042316g6e774d60n90dfc4784d3b66bf@mail.gmail.com>
On Fri, 2010-03-05 at 15:16 +0800, Américo Wang wrote:
> On Fri, Mar 5, 2010 at 12:14 PM, Américo Wang <xiyou.wangcong@gmail.com> wrote:
> > On Thu, Mar 4, 2010 at 9:54 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> >> On Wed, 2010-03-03 at 14:04 +0800, Américo Wang wrote:
> >>> I am not sure if this is ftrace's fault, but it is ftrace who triggers
> >>> the soft lockup. On my machine, it is pretty easy, just run:
> >>>
> >>> echo function_graph > current_tracer
> >>>
> >
> > I can't say that because I didn't try -rc6.
> >
>
> Sigh, 2.6.33-rc6 doesn't work, even 2.6.32 doesn't work...
So basically you are saying that the function_graph tracer, when enabled
has a high overhead? Well, unfortunately, that's expected.
The function_graph tracer traces the start and end of every function. It
uses the same mechanism as function tracer to trace the start of the
function (mcount), but to trace the exit of a function, in the enter of
the function it hijacks the return address and replaces it to call a
trampoline. This trampoline will do the trace and then jump back to the
original return address.
Doing this breaks branch prediction in the CPU, as the CPU uses call/ret
as part of its branch prediction analysis. So function graph tracing is
not just twice as slow as function tracing, it actually has a bigger
impact than that.
So my question to you is, have you seen the function graph perform
better with the same configs in previous kernels? Also, the function
graph makes other debugging (like lockdep) have a greater impact to
performance than they usually do.
Now some things you can do to help performance. One is not to trace
functions that are known to have a high hit rate. You can do this with
the set_ftrace_notrace file, or add "ftrace_notrace=func1,func2,func3"
to the command line where func1,func2,func3 are the functions you do not
want to trace. This just adds these by default to the set_ftrace_notrace
and can be removed at runtime.
The functions I commonly write to are:
echo '*spin_lock*' '*spin_unlock*' '*spin_try*' '*rcu_read*' > set_ftace_notrace
since these functions are hit quite intensively, by not tracing them it
helps a bit with performance.
-- Steve
next prev parent reply other threads:[~2010-03-05 15:06 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 6:04 Américo Wang
2010-03-03 13:05 ` Steven Rostedt
2010-03-04 2:58 ` Américo Wang
2010-03-04 1:33 ` Li Zefan
2010-03-04 1:46 ` Frederic Weisbecker
2010-03-04 3:01 ` Américo Wang
2010-03-04 3:18 ` Steven Rostedt
2010-03-04 4:06 ` Frederic Weisbecker
2010-03-04 5:10 ` Américo Wang
2010-03-04 5:18 ` Frederic Weisbecker
2010-03-04 13:54 ` Steven Rostedt
2010-03-05 4:14 ` Américo Wang
2010-03-05 7:16 ` Américo Wang
2010-03-05 15:06 ` Steven Rostedt [this message]
2010-03-05 17:16 ` Frederic Weisbecker
2010-03-05 18:35 ` Steven Rostedt
2010-03-05 18:43 ` Frederic Weisbecker
2010-03-05 19:07 ` Steven Rostedt
2010-03-08 7:32 ` Li Zefan
2010-03-08 15:15 ` Steven Rostedt
2010-03-09 2:11 ` Li Zefan
2010-03-09 2:23 ` Steven Rostedt
2010-03-09 3:38 ` Li Zefan
2010-03-12 19:20 ` Steven Rostedt
2010-03-12 21:38 ` Steven Rostedt
2010-03-13 2:07 ` Steven Rostedt
2010-03-13 5:37 ` Américo Wang
2010-03-13 5:51 ` Steven Rostedt
2010-03-14 16:55 ` Steven Rostedt
2010-03-13 17:56 ` Steven Rostedt
2010-03-15 1:46 ` Li Zefan
2010-03-15 14:39 ` Steven Rostedt
2010-03-15 16:16 ` Steven Rostedt
2010-03-08 2:31 ` Américo Wang
2010-03-09 2:40 ` Américo Wang
2010-03-09 2:51 ` Steven Rostedt
2010-03-09 5:06 ` Américo Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267801603.10871.1725.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®