From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Bugfix] unregister_trace_probe needs to be called under mutex
Date: Wed, 30 Jun 2010 12:00:29 -0400 [thread overview]
Message-ID: <1277913629.24800.29.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1277891066.1868.107.camel@laptop>
On Wed, 2010-06-30 at 11:44 +0200, Peter Zijlstra wrote:
> On Wed, 2010-06-30 at 14:15 +0530, Srikar Dronamraju wrote:
> > Comment in unregister_trace_probe() says probe_lock will be held
> > when it gets called. However there is a case where it might called
> > without the probe_lock being held. Also since we are traversing the
> > probe_list and deleting an element from the probe_list, probe_lock
> > should be held.
> >
> > This was first pointed in uprobes traceevent review by Frederic
> > Weisbecker here. (http://lkml.org/lkml/2010/5/12/106)
> >
> > This patch is needed for both 2.6.35-rc3 and 2.6.35-rc3-tip
Acked-by: Steven Rostedt <rostedt@goodmis.org>
> >
> > Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> > ---
> >
> > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> > index 4f11a56..67670cd 100644
> > --- a/kernel/trace/trace_kprobe.c
> > +++ b/kernel/trace/trace_kprobe.c
> > @@ -269,14 +269,17 @@ static int create_trace_probe(int argc, char **argv)
> > pr_info("Delete command needs an event name.\n");
> > return -EINVAL;
> > }
> > + mutex_lock(&probe_lock);
> > tp = find_probe_event(event, group);
> > if (!tp) {
> > + mutex_unlock(&probe_lock);
> > pr_info("Event %s/%s doesn't exist.\n", group, event);
> > return -ENOENT;
> > }
> > /* delete an event */
> > unregister_trace_probe(tp);
> > free_trace_probe(tp);
> > + mutex_unlock(&probe_lock);
> > return 0;
> > }
>
> Shouldn't all that go through steven's ->reg() interface?
Nah, this is specific to the kprobe code. Has really nothing to do with
the ->reg() interface.
-- Steve
next prev parent reply other threads:[~2010-06-30 16:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 8:45 Srikar Dronamraju
2010-06-30 9:44 ` Peter Zijlstra
2010-06-30 10:49 ` Srikar Dronamraju
2010-06-30 16:00 ` Steven Rostedt [this message]
2010-07-01 1:09 ` Masami Hiramatsu
2010-07-06 5:08 ` Srikar Dronamraju
2010-08-05 8:01 ` [tip:perf/core] tracing/kprobes: " tip-bot for Srikar Dronamraju
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=1277913629.24800.29.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srikar@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®