[PATCH -next] tracepoint: ipi: don't trace IPI on offline CPUs
From: Sudeep Holla
Date: Wed Mar 09 2016 - 07:22:46 EST
Tracepoints use RCU for protection and they must not be called on
offline CPUS. So make this tracepoint conditional. Otherwise it can
produce the following warning:
[ INFO: suspicious RCU usage. ]
4.5.0-rc7-next-20160308 #44 Not tainted
include/trace/events/ipi.h:35 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
RCU used illegally from offline CPU!
rcu_scheduler_active = 1, debug_locks = 1
no locks held by swapper/3/0.
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.5.0-rc7-next-20160308 #44
Hardware name: ARM Juno development board (r2) (DT)
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
include/trace/events/ipi.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
I observed that in "include/linux/tracepoint.h", we have
#define __DO_TRACE(tp, proto, args, cond, prercu, postrcu)
where !cond check seems reduntant if it's cpu_online check.
So, does this patch handle the warning correctly or is there any better
way ? I did see few traces with same condition, just thought of checking
diff --git a/include/trace/events/ipi.h b/include/trace/events/ipi.h
index 834a7362a610..d8ca2f2e24ac 100644
@@ -15,12 +15,14 @@
* It is necessary for @reason to be a static string declared with
TP_PROTO(const struct cpumask *mask, const char *reason),
__field(const char *, reason)