Skip to content

Commit d628409

Browse files
committed
trace: Allow idle-safe tracepoints to be called from irq
__DECLARE_TRACE_RCU() currently creates an _rcuidle() tracepoint which may safely be invoked from what RCU considers to be an idle CPU. However, these _rcuidle() tracepoints may -not- be invoked from the handler of an irq taken from idle, because rcu_idle_enter() zeroes RCU's nesting-level counter, so that the rcu_irq_exit() returning to idle will trigger a WARN_ON_ONCE(). This commit therefore substitutes rcu_irq_enter() for rcu_idle_exit() and rcu_irq_exit() for rcu_idle_enter() in order to make the _rcuidle() tracepoints usable from irq handlers as well as from process context. Reported-by: Dave Jones <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Steven Rostedt <[email protected]>
1 parent 317ddd2 commit d628409

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/tracepoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static inline void tracepoint_synchronize_unregister(void)
145145
TP_PROTO(data_proto), \
146146
TP_ARGS(data_args), \
147147
TP_CONDITION(cond), \
148-
rcu_idle_exit(), \
149-
rcu_idle_enter()); \
148+
rcu_irq_enter(), \
149+
rcu_irq_exit()); \
150150
}
151151
#else
152152
#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args)

0 commit comments

Comments
 (0)