Re: [PATCH tip/urgent] rcu: add rcu_access_pointer andrcu_dereference_protected

From: Paul E. McKenney
Date: Thu Apr 08 2010 - 12:46:27 EST


On Wed, Apr 07, 2010 at 04:00:09PM -0700, Paul E. McKenney wrote:
> On Wed, Apr 07, 2010 at 06:20:48PM +0100, David Howells wrote:
> > Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > > In other cases, there will be a reference counter or a "not yet fully
> > > initialized" flag that can (and should) be tested.
> >
> > Why would you be using rcu_access_pointer() there? Why wouldn't you be using
> > rcu_dereference_protected()?
>
> Excellent question. I am writing up the documentation now, and will
> either (1) have a good use case or (2) remove the condition.

And all of the examples I could come up with that had c!=1 were contorted,
even by my standards. So you were right, and I will drop the "c" on my
next set of patches.

Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/