rcu: Add rcu_access_pointer and rcu_dereference_protected
rcu: Add rcu_access_pointer and rcu_dereference_protected

This patch adds variants of rcu_dereference() that handle
situations where the RCU-protected data structure cannot change,
perhaps due to our holding the update-side lock, or where the
RCU-protected pointer is only to be fetched, not dereferenced.
These are needed due to some performance concerns with using
rcu_dereference() where it is not required, aside from the need
for lockdep/sparse checking.

The new rcu_access_pointer() primitive is for the case where the
pointer is be fetch and not dereferenced.  This primitive may be
used without protection, RCU or otherwise, due to the fact that
it uses ACCESS_ONCE().

The new rcu_dereference_protected() primitive is for the case
where updates are prevented, for example, due to holding the
update-side lock.  This primitive does neither ACCESS_ONCE() nor
smp_read_barrier_depends(), so can only be used when updates are
somehow prevented.

Suggested-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com>
Signed-off-by: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Cc: 4c9eb49378914b743bdd32292c04df29b820d73e@cn.fujitsu.com
Cc: a6f1be4247cea11e3150b15872843079f20d7078@in.ibm.com
Cc: 007bef6a47fb57dff675bfa1b0b798b4bdfbfc25@polymtl.ca
Cc: c028c213ed5efcf30c3f4fc7361dbde0c893c5b7@joshtriplett.org
Cc: 6620bce6bfb8b2ba8b188f43804848d35a9a4d76@us.ibm.com
Cc: a103ef9226f51cd1e5e835b2f74c82dfb33d1ccb@us.ibm.com
Cc: 3fddac958924aef220f202ca567388ddab3f14a8@infradead.org
Cc: 43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org
Cc: 183bdd1d6873c97a167cc4b441324ddf7a94dd06@vt.edu
Cc: ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com
Cc: a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com
LKML-Reference: <1270852752-25278-1-git-send-email-1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas