[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100513182556.GA14326@linux.vnet.ibm.com>
Date: Thu, 13 May 2010 11:25:56 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: mingo@...e.hu, fweisbec@...il.com, a.p.zijlstra@...llo.nl,
paulus@...ba.org, acme@...hat.com
Subject: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep splat
This commit guesses at the perf_cpu_context locking design and deploys
an rcu_dereference_check() accordingly. The design appears to require
that a given CPU be accessing its own per_cpu_context or that it be
traversing under RCU protection.
Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
perf_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a4fa381..002791c 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4074,7 +4074,9 @@ find_swevent_head(struct perf_cpu_context *ctx, u64 type, u32 event_id)
hash = swevent_hash(type, event_id);
- hlist = rcu_dereference(ctx->swevent_hlist);
+ hlist = rcu_dereference_check(ctx->swevent_hlist,
+ rcu_read_lock_held() ||
+ ctx == &__get_cpu_var(perf_cpu_context));
if (!hlist)
return NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists