Re: [PATCH RFC] tracepoint: Introduce tracepoint callbacks executing with preempt on
From: Joel Fernandes
Date: Fri Apr 27 2018 - 12:22:41 EST
On Fri, Apr 27, 2018 at 9:13 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Fri, 27 Apr 2018 08:57:01 -0700
> "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx> 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;
Cool, I'll do that.
>>
>> > + 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.
Oh yes, since otherwise we call into lockdep.
Paul, then I think that's true we'd need srcu _notrace variants that
don't do the rcu_lock_acquire. Sorry for my earlier email saying its
not needed. Thanks,
- Joel