Re: [PATCH 3/8] ftrace: Add enable/disable ftrace_ops controlinterface
From: Frederic Weisbecker
Date: Mon Jan 23 2012 - 20:27:02 EST
On Wed, Dec 21, 2011 at 11:01:33AM -0500, Steven Rostedt wrote:
> On Wed, 2011-12-21 at 12:48 +0100, Jiri Olsa wrote:
> > +static int control_ops_is_disabled(struct ftrace_ops *ops)
> > +{
> > + atomic_t *disabled = this_cpu_ptr(ops->disabled);
>
> Again, the use of "this_cpu_ptr" is wrong. Gah! We should nuke all of
> that crap.
>
Is it? It includes the preemption check if CONFIG_DEBUG_PREEMPT, just
like __get_cpu_var()
Just saying that because in a later version of this patch, Jiri used
per_cpu_ptr(ops->disabled, cpu). And this is the wrong thing to do
given that we always fetch the local pointer and per_cpu_ptr() doesn't
check for preemption disabled.
> > + return atomic_read(disabled);
> > +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/