Commit ed384464 authored by Milos Vyletel's avatar Milos Vyletel Committed by Paul E. McKenney

documentation: State that rcu_dereference() reloads pointer

Make a note stating that repeated calls of rcu_dereference() may not
return the same pointer if update happens while in critical section.
Reported-by: default avatarJeff Haran <jeff.haran@citrix.com>
Signed-off-by: default avatarMilos Vyletel <milos@redhat.com>
Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent ee7c29be
...@@ -256,7 +256,9 @@ rcu_dereference() ...@@ -256,7 +256,9 @@ rcu_dereference()
If you are going to be fetching multiple fields from the If you are going to be fetching multiple fields from the
RCU-protected structure, using the local variable is of RCU-protected structure, using the local variable is of
course preferred. Repeated rcu_dereference() calls look course preferred. Repeated rcu_dereference() calls look
ugly and incur unnecessary overhead on Alpha CPUs. ugly, do not guarantee that the same pointer will be returned
if an update happened while in the critical section, and incur
unnecessary overhead on Alpha CPUs.
Note that the value returned by rcu_dereference() is valid Note that the value returned by rcu_dereference() is valid
only within the enclosing RCU read-side critical section. only within the enclosing RCU read-side critical section.
......
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