[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100802151445.GA11747@Krystal>
Date: Mon, 2 Aug 2010 11:14:46 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Li Zefan <lizf@...fujitsu.com>
Subject: Re: [PATCH 01/12] perf: Use tracepoint_synchronize_unregister() to
flush any pending tracepoint call
* Frederic Weisbecker (fweisbec@...il.com) wrote:
> We use synchronize_sched() to ensure a tracepoint won't be called
> while/after we release the perf buffers it references.
>
> But the tracepoint API has its own API for that:
> tracepoint_synchronize_unregister(). Use it instead as it's
> self-explanatory and eases maintainance.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Thanks!
Mathieu
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Li Zefan <lizf@...fujitsu.com>
> ---
> kernel/trace/trace_event_perf.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
> index 2375165..000e6e8 100644
> --- a/kernel/trace/trace_event_perf.c
> +++ b/kernel/trace/trace_event_perf.c
> @@ -131,10 +131,10 @@ void perf_trace_destroy(struct perf_event *p_event)
> tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER);
>
> /*
> - * Ensure our callback won't be called anymore. See
> - * tracepoint_probe_unregister() and __DO_TRACE().
> + * Ensure our callback won't be called anymore. The buffers
> + * will be freed after that.
> */
> - synchronize_sched();
> + tracepoint_synchronize_unregister();
>
> free_percpu(tp_event->perf_events);
> tp_event->perf_events = NULL;
> --
> 1.6.2.3
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists