perf: perf_event_exit_task_context: s/rcu_dereference/rcu_dereference_raw/
authorOleg Nesterov <[email protected]>
Fri, 21 Jan 2011 17:45:47 +0000 (18:45 +0100)
committerIngo Molnar <[email protected]>
Fri, 21 Jan 2011 21:08:16 +0000 (22:08 +0100)
In theory, almost every user of task->child->perf_event_ctxp[]
is wrong. find_get_context() can install the new context at any
moment, we need read_barrier_depends().

dbe08d82ce3967ccdf459f7951d02589cf967300 "perf: Fix
find_get_context() vs perf_event_exit_task() race" added
rcu_dereference() into perf_event_exit_task_context() to make
the precedent, but this makes __rcu_dereference_check() unhappy.
Use rcu_dereference_raw() to shut up the warning.

Reported-by: Ingo Molnar <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Paul E. McKenney <[email protected]>
LKML-Reference: <20110121174547[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/perf_event.c

index c5fa717cf0991ecba0ca9d6244d386f1e8fda4a6..126a302c481c060782e811e92e3fca0386271208 100644 (file)
@@ -6136,7 +6136,7 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn)
         * scheduled, so we are now safe from rescheduling changing
         * our context.
         */
-       child_ctx = rcu_dereference(child->perf_event_ctxp[ctxn]);
+       child_ctx = rcu_dereference_raw(child->perf_event_ctxp[ctxn]);
        task_ctx_sched_out(child_ctx, EVENT_ALL);
 
        /*