Commit 137f61f6 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Adjust read-side accessor comments for READ_ONCE()

Now that READ_ONCE() implies smp_read_barrier_depends(), the commit
updates now-misleading comments to account for this change.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent b393e8b3
...@@ -433,12 +433,12 @@ static inline void rcu_preempt_sleep_check(void) { } ...@@ -433,12 +433,12 @@ static inline void rcu_preempt_sleep_check(void) { }
* @p: The pointer to read * @p: The pointer to read
* *
* Return the value of the specified RCU-protected pointer, but omit the * Return the value of the specified RCU-protected pointer, but omit the
* smp_read_barrier_depends() and keep the READ_ONCE(). This is useful * lockdep checks for being in an RCU read-side critical section. This is
* when the value of this pointer is accessed, but the pointer is not * useful when the value of this pointer is accessed, but the pointer is
* dereferenced, for example, when testing an RCU-protected pointer against * not dereferenced, for example, when testing an RCU-protected pointer
* NULL. Although rcu_access_pointer() may also be used in cases where * against NULL. Although rcu_access_pointer() may also be used in cases
* update-side locks prevent the value of the pointer from changing, you * where update-side locks prevent the value of the pointer from changing,
* should instead use rcu_dereference_protected() for this use case. * you should instead use rcu_dereference_protected() for this use case.
* *
* It is also permissible to use rcu_access_pointer() when read-side * It is also permissible to use rcu_access_pointer() when read-side
* access to the pointer was removed at least one grace period ago, as * access to the pointer was removed at least one grace period ago, as
...@@ -521,12 +521,11 @@ static inline void rcu_preempt_sleep_check(void) { } ...@@ -521,12 +521,11 @@ static inline void rcu_preempt_sleep_check(void) { }
* @c: The conditions under which the dereference will take place * @c: The conditions under which the dereference will take place
* *
* Return the value of the specified RCU-protected pointer, but omit * Return the value of the specified RCU-protected pointer, but omit
* both the smp_read_barrier_depends() and the READ_ONCE(). This * the READ_ONCE(). This is useful in cases where update-side locks
* is useful in cases where update-side locks prevent the value of the * prevent the value of the pointer from changing. Please note that this
* pointer from changing. Please note that this primitive does *not* * primitive does *not* prevent the compiler from repeating this reference
* prevent the compiler from repeating this reference or combining it * or combining it with other references, so it should not be used without
* with other references, so it should not be used without protection * protection of appropriate locks.
* of appropriate locks.
* *
* This function is only for update-side use. Using this function * This function is only for update-side use. Using this function
* when protected only by rcu_read_lock() will result in infrequent * when protected only by rcu_read_lock() will result in infrequent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment