Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep splat

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Thursday, May 13, 2010 - 4:43 pm

On Thu, May 13, 2010 at 10:59:26PM +0200, Frederic Weisbecker wrote:

That would be very good!!!  I believe that I have already more than proven
my ignorance of the perf_event code.  ;-)


This is appropriate if find_swevent_head_rcu() is always invoked in an
RCU read-side critical section.  (Which at first glance does appear to
be the intent, just checking.)


This could be invoked with either the event->ctx->lock held or in
an RCU read-side critical section.  If this is always called with
the update-side lock held, you can (but don't need to) instead say:

	hlist = rcu_dereference_protected(ctx->swevent_hlist,
				          lockdep_is_held(&event->ctx->lock));

This is slightly faster, as it drops the volatile casts.  In many cases,
you won't care, but in case this code path needs ultimate performance.

Also I thought it was event->ctx.lock, but at this point I trust your eyes
more than my own.  ;-)

							Thanx, Paul

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] perf: fix find_swevent_head() RCU lockdep splat, Paul E. McKenney, (Thu May 13, 11:25 am)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 13, 12:03 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Paul E. McKenney, (Thu May 13, 12:46 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 13, 1:26 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 13, 1:48 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 13, 1:59 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Paul E. McKenney, (Thu May 13, 4:43 pm)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 20, 12:01 am)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 20, 12:04 am)
Re: [PATCH RFC] perf: fix find_swevent_head() RCU lockdep ..., Frederic Weisbecker, (Thu May 20, 12:04 am)