mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <tzanussi@gmail.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Steven Rostedt <rostedt@goodmis.org>,
	paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH] tracing/filters: allow on-the-fly filter switching
Date: Tue, 14 Apr 2009 23:32:25 -0500	[thread overview]
Message-ID: <1239769945.7852.21.camel@tropicana> (raw)
In-Reply-To: <20090414205635.GA5968@nowhere>

On Tue, 2009-04-14 at 22:56 +0200, Frederic Weisbecker wrote:
> On Mon, Apr 13, 2009 at 03:17:50AM -0500, Tom Zanussi wrote:

[...]

> 
> 
> BTW, this issue might be already present before this patch.
> What happens if:
> 
> 
> 	T1				T2
> 
> event_filter_read() {
>   filter_print_preds() {
>     for (i = 0; i < n_preds; i++) {
> 	pred = preds[i];
> 				    event_filter_write() {
> 					filter_disable_preds();
> 					filter_clear_preds() {
> 					  kfree(pred->field_name);
> 	field_name = pred->field_name;
> 	// CRASH!!!
> 
> 
> You need a mutex to protect these two callbacks.
> It would also protect concurrent calls to event_filter_write(),
> which would result in random.
> 

Yeah, Li Zefan had already fixed this, but it wasn't included in this
patch.  Looks like he'll be resubmitting that part...

> 
> 

[...]

> Also, is filter_add_pred() supposed to be available for in-kernel
> uses by other tracers or something?

No, the current callers were the only ones I'd planned on (it's not
static because code in trace_events.c needs to call it).  But, do you
see a use for it by other tracers?

> If this is planned, the locking could be even deeper than my comments.
> 
> Other than these comments:
> 
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> 
> Thanks!
> 

Thanks for reviewing it!

Tom


  parent reply	other threads:[~2009-04-15  4:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13  8:17 Tom Zanussi
2009-04-13 21:52 ` Ingo Molnar
2009-04-14  0:33 ` [tip:tracing/core] " tip-bot for Tom Zanussi
2009-04-14 20:56 ` [PATCH] " Frederic Weisbecker
2009-04-15  1:12   ` Li Zefan
2009-04-15  1:55     ` Frederic Weisbecker
2009-04-15  4:17     ` Tom Zanussi
2009-04-15  4:32   ` Tom Zanussi [this message]
2009-04-15 16:21     ` Frederic Weisbecker
2009-04-16  0:54       ` Li Zefan
2009-04-16  5:34         ` Tom Zanussi
2009-04-16 15:29         ` Frederic Weisbecker

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=1239769945.7852.21.camel@tropicana \
    --to=tzanussi@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.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®