rcu, ftrace: Fix RCU lockdep splat in ftrace_perf_buf_prepare()
authorPaul E. McKenney <[email protected]>
Thu, 4 Mar 2010 01:50:18 +0000 (17:50 -0800)
committerIngo Molnar <[email protected]>
Thu, 4 Mar 2010 11:07:35 +0000 (12:07 +0100)
Change the pair of rcu_dereference() calls in
ftrace_perf_buf_prepare() to rcu_dereference_sched().

Signed-off-by: Paul E. McKenney <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Frederic Weisbecker <[email protected]>
LKML-Reference: <1267667418[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
include/trace/ftrace.h
kernel/trace/trace_event_profile.c

index 0804cd5948035d9dd8d59084e946c1d32cad330c..601ad7744247582feeec95555464ce4b8a2bdc0d 100644 (file)
@@ -699,9 +699,9 @@ __attribute__((section("_ftrace_events"))) event_##call = {         \
  *     __cpu = smp_processor_id();
  *
  *     if (in_nmi())
- *             trace_buf = rcu_dereference(perf_trace_buf_nmi);
+ *             trace_buf = rcu_dereference_sched(perf_trace_buf_nmi);
  *     else
- *             trace_buf = rcu_dereference(perf_trace_buf);
+ *             trace_buf = rcu_dereference_sched(perf_trace_buf);
  *
  *     if (!trace_buf)
  *             goto end;
index f0d693005075c938a7163e38f67171587814f0cc..c1cc3ab633de6cab14b87463d4f70669feb8904b 100644 (file)
@@ -138,9 +138,9 @@ __kprobes void *ftrace_perf_buf_prepare(int size, unsigned short type,
        cpu = smp_processor_id();
 
        if (in_nmi())
-               trace_buf = rcu_dereference(perf_trace_buf_nmi);
+               trace_buf = rcu_dereference_sched(perf_trace_buf_nmi);
        else
-               trace_buf = rcu_dereference(perf_trace_buf);
+               trace_buf = rcu_dereference_sched(perf_trace_buf);
 
        if (!trace_buf)
                goto err;