From: Joel Fernandes (Google) Date: Thu, 28 Jun 2018 18:21:44 +0000 (-0700) Subject: srcu: Add notrace variant of srcu_dereference X-Git-Tag: v4.19~319^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b764a6e4e19dc254caca636002eaa47b1d0b0af;p=platform%2Fkernel%2Flinux-rpi.git srcu: Add notrace variant of srcu_dereference In the last patch in this series, we are making lockdep register hooks onto the irq_{disable,enable} tracepoints. These tracepoints use the _rcuidle tracepoint variant. In this series we switch the _rcuidle tracepoint callers to use SRCU instead of sched-RCU. Inorder to dereference the pointer to the probe functions, we could call srcu_dereference, however this API will call back into lockdep to check if the lock is held *before* the lockdep probe hooks have a chance to run and annotate the IRQ enabled/disabled state. For this reason we need a notrace variant of srcu_dereference since otherwise we get lockdep splats. This patch adds the needed srcu_dereference_notrace variant. Link: http://lkml.kernel.org/r/20180628182149.226164-3-joel@joelfernandes.org Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) --- diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 3e72a29..67135d4 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -170,6 +170,11 @@ static inline int srcu_read_lock_held(const struct srcu_struct *sp) #define srcu_dereference(p, sp) srcu_dereference_check((p), (sp), 0) /** + * srcu_dereference_notrace - no tracing and no lockdep calls from here + */ +#define srcu_dereference_notrace(p, sp) srcu_dereference_check((p), (sp), 1) + +/** * srcu_read_lock - register a new reader for an SRCU-protected structure. * @sp: srcu_struct in which to register the new reader. *