diff mbox

[1/2] docs/rcu: Distinguish rcu_dereference and atomic_rcu_read

Message ID 20161018145620.20658-1-bobby.prani@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pranith Kumar Oct. 18, 2016, 2:56 p.m. UTC
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 docs/rcu.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini Oct. 18, 2016, 9:50 p.m. UTC | #1
----- Original Message -----
> From: "Pranith Kumar" <bobby.prani@gmail.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "Sergey Fedorov" <serge.fdrv@gmail.com>, "Cao jin"
> <caoj.fnst@cn.fujitsu.com>, "open list:All patches CC here" <qemu-devel@nongnu.org>
> Sent: Tuesday, October 18, 2016 4:56:19 PM
> Subject: [PATCH 1/2] docs/rcu: Distinguish rcu_dereference and atomic_rcu_read
> 
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  docs/rcu.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/rcu.txt b/docs/rcu.txt
> index c84e7f4..c177dcb 100644
> --- a/docs/rcu.txt
> +++ b/docs/rcu.txt
> @@ -197,7 +197,9 @@ DIFFERENCES WITH LINUX
>    critical section to become an updater.
>  
>  - atomic_rcu_read and atomic_rcu_set replace rcu_dereference and
> -  rcu_assign_pointer.  They take a _pointer_ to the variable being accessed.
> +  rcu_assign_pointer.  Note that although both atomic_rcu_read and
> +  rcu_dereference take a _pointer_ to the variable being accessed,
> +  atomic_rcu_read dereferences the pointer whereas rcu_dereference does not.

No, neither rcu_dereference nor rcu-assign_pointer take a pointer.  You use
them like rcu_dereference(p) versus QEMU's atomic_rcu_read(&p).

Paolo

>  - call_rcu is a macro that has an extra argument (the name of the first
>    field in the struct, which must be a struct rcu_head), and expects the
> --
> 2.10.1
> 
>
diff mbox

Patch

diff --git a/docs/rcu.txt b/docs/rcu.txt
index c84e7f4..c177dcb 100644
--- a/docs/rcu.txt
+++ b/docs/rcu.txt
@@ -197,7 +197,9 @@  DIFFERENCES WITH LINUX
   critical section to become an updater.
 
 - atomic_rcu_read and atomic_rcu_set replace rcu_dereference and
-  rcu_assign_pointer.  They take a _pointer_ to the variable being accessed.
+  rcu_assign_pointer.  Note that although both atomic_rcu_read and
+  rcu_dereference take a _pointer_ to the variable being accessed,
+  atomic_rcu_read dereferences the pointer whereas rcu_dereference does not.
 
 - call_rcu is a macro that has an extra argument (the name of the first
   field in the struct, which must be a struct rcu_head), and expects the