From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>, Oleg Nesterov <oleg@redhat.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"yrl.pp-manager.tt@hitachi.com" <yrl.pp-manager.tt@hitachi.com>
Subject: Re: [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer
Date: Fri, 14 Jun 2013 10:25:16 -0700 [thread overview]
Message-ID: <20130614172516.GP5146@linux.vnet.ibm.com> (raw)
In-Reply-To: <1371227607.9844.335.camel@gandalf.local.home>
On Fri, Jun 14, 2013 at 12:33:27PM -0400, Steven Rostedt wrote:
> On Fri, 2013-06-14 at 09:21 -0700, Paul E. McKenney wrote:
>
> > > > > @@ -548,15 +556,35 @@ static void uprobe_trace_print(struct trace_uprobe *tu,
> > > > > /* uprobe handler */
> > > > > static int uprobe_trace_func(struct trace_uprobe *tu, struct pt_regs *regs)
> > > > > {
> > > > > - if (!is_ret_probe(tu))
> > > > > - uprobe_trace_print(tu, 0, regs);
> > > > > + struct ftrace_event_file **file;
> > > > > +
> > > > > + if (is_ret_probe(tu))
> > > > > + return 0;
> > > > > +
> > > > > + file = rcu_dereference_raw(tu->files);
> > >
> > > Why are you using rcu_dereference_raw() and not rcu_dereference(). The
> > > _raw() is a bit special, and unless you know what you are doing with RCU
> > > here, don't use it.
> > >
> > > As I see you using rcu_dereference_raw() all over this patch, along with
> > > mutexes, I believe that you are not using RCU correctly here.
> >
> > If irqs and preempt are disabled, I suggest using rcu_dereference_sched().
> > That is what it is there for. ;-)
>
> I believe this just copied what kprobes did, where irqs and preemption
> is disabled. I don't believe that these probes have that same luxury.
>
> But that begs the question. Should we convert the rcu_dereference_raw()
> in the kprobe code to rcu_dereference_sched()?
It makes a lot of sense to me, at least assuming no issues with the
interrupts being disabled, but the checks not spotting this. Here
is the check:
preempt_count() != 0 || irqs_disabled()
(With additional elaboration for if lockdep is enabled.)
Thanx, Paul
next prev parent reply other threads:[~2013-06-14 17:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 1:44 [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer zhangwei(Jovi)
2013-06-14 13:21 ` Masami Hiramatsu
2013-06-14 13:51 ` Oleg Nesterov
2013-06-14 14:09 ` Oleg Nesterov
2013-06-14 15:31 ` Steven Rostedt
2013-06-14 16:21 ` Paul E. McKenney
2013-06-14 16:33 ` Steven Rostedt
2013-06-14 17:25 ` Paul E. McKenney [this message]
2013-06-17 2:54 ` Masami Hiramatsu
2013-06-17 12:33 ` Steven Rostedt
2013-06-18 1:31 ` Masami Hiramatsu
2013-06-18 2:02 ` Steven Rostedt
2013-06-14 14:44 ` Oleg Nesterov
2013-06-14 16:04 ` ftrace multibuffer && rcu (Was: tracing/uprobes: Support ftrace_event_file base multibuffer) Oleg Nesterov
2013-06-14 16:18 ` Oleg Nesterov
2013-06-14 16:26 ` Steven Rostedt
2013-06-14 17:02 ` Oleg Nesterov
2013-06-20 16:43 ` [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer Oleg Nesterov
2013-06-21 8:17 ` zhangwei(Jovi)
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=20130614172516.GP5146@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=fweisbec@gmail.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.com \
--cc=yrl.pp-manager.tt@hitachi.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