Re: [PATCH RFC] tracepoint: Introduce tracepoint callbacks executing with preempt on

Steven Rostedt
2018-04-27T16:13:35Z

On Fri, 27 Apr 2018 08:57:01 -0700
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:

> > + if (preempt_on) { \
> > + WARN_ON_ONCE(in_nmi()); /* no srcu from nmi */ \
>
> Very good on this check, thank you!

I think you need to return and not call the read lock.

if (WARN_ON_ONCE(in_nmi()))
return;

>
> > + idx = srcu_read_lock(&tracepoint_srcu); \
>
> Hmmm... Do I need to create a _notrace variant of srcu_read_lock()
> and srcu_read_unlock()?

I think so.

-- Steve

>
> > + it_func_ptr = srcu_dereference((tp)->funcs, \
> > + &tracepoint_srcu); \
> > + } else { \
> > + rcu_read_lock_sched_notrace(); \
> > + it_func_ptr = \
> > + rcu_dereference_sched((tp)->funcs); \
> > + } \
> > + \