From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>,
Dave Jones <davej@redhat.com>, Tejun Heo <tj@kernel.org>,
tglx@linutronix.de, LKML <linux-kernel@vger.kernel.org>,
trinity@vger.kernel.org
Subject: Re: timer: lockup in run_timer_softirq()
Date: Wed, 10 Jul 2013 08:27:34 -0400 [thread overview]
Message-ID: <1373459254.7458.49.camel@gandalf.local.home> (raw)
In-Reply-To: <20130710095210.GD17211@twins.programming.kicks-ass.net>
On Wed, 2013-07-10 at 11:52 +0200, Peter Zijlstra wrote:
> Fun.. :-) we trace __local_bh_enable() and hit a ftrace callback between
> telling lockdep we enabled softirqs and actually doing so.
>
> I'm just a tad confused by the trace; it says we go:
> lock_is_held()
> check_flags()
>
> Looking at perf_tp_event() this would most likely be from:
>
> ctx = rcu_dereference(task->perf_event_ctxp[perf_sw_context]);
Function tracing should not be treated as a normal trace point. It is
much more invasive, and there's things that one should be weary about
when using it.
>
> Where the lock_is_held() would be from rcu_dereference_check()'s
> rcu_read_lock_sched_held(). However, by there we've already passed
> rcu_read_lock() which includes rcu_lock_acquire() -> lock_acquire() ->
> check_flags(). So it should've triggered there.
>
> Ideally we'd not trace __local_bh_enable() at all, seeing as how any RCU usage
> in there would be bound to trigger this.
I find it very useful to trace __local_bh_enable(). I also trace RCU
calls.
When using function tracing, you need to use
rcu_dereference_raw_notrace().
Also, function tracing callbacks should avoid rcu_read_lock(), as that's
traced as well. You can use preempt_disable_notrace() for rcu usage.
-- Steve
next prev parent reply other threads:[~2013-07-10 12:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 22:35 timer: lockup in run_timer_softirq() Sasha Levin
2013-07-09 22:47 ` Dave Jones
2013-07-09 22:49 ` Sasha Levin
2013-07-09 23:03 ` Dave Jones
2013-07-09 23:09 ` Sasha Levin
2013-07-10 9:52 ` Peter Zijlstra
2013-07-10 12:27 ` Steven Rostedt [this message]
2013-07-10 12:42 ` Peter Zijlstra
2013-07-10 12:58 ` Steven Rostedt
2013-07-11 16:42 ` Peter Zijlstra
2013-07-11 16:55 ` Steven Rostedt
2013-07-11 16:59 ` Steven Rostedt
2013-07-11 17:11 ` Peter Zijlstra
2014-04-03 20:43 ` Sasha Levin
2013-07-10 9:54 ` Peter Zijlstra
2013-07-10 14:47 ` Sasha Levin
2013-07-11 10:02 ` Peter Zijlstra
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=1373459254.7458.49.camel@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sasha.levin@oracle.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=trinity@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).