Re: [PATCH] tracing/uprobes: Support ftrace_event_file basemultibuffer

From: Steven Rostedt
Date: Mon Jun 17 2013 - 08:33:20 EST


On Mon, 2013-06-17 at 11:54 +0900, Masami Hiramatsu wrote:

> > 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.)
>
> OK, I see. So I'll convert all the rcu_dereference_raw() to
> rcu_dereference_sched() except kprobe handler, because in the
> kprobe handler above check always be true. :)

I would convert them all to rcu_dereference_sched(), the above check is
only when CONFIG_DEBUG_LOCK_ALLOC is set. It also annotates what is
protecting this variable. Please do not avoid a check because "it's
always true here". You also get people copying that code (like for
uprobes) and that will skip the check too.

The only reason ftrace function tracer uses the raw (and now
raw_notrace) version is because it is extremely invasive, and these
checks done at *every* function call can actually live lock the system.
But other places in tracing use the appropriate rcu_dereference_*()
functions. If they do not, then they need to be fixed too.

-- Steve


--
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/