qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Emilio G. Cota" <cota@braap.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, mttcg@greensocs.com
Subject: Re: [Qemu-devel] [PATCH] docs/atomics: update comparison with Linux
Date: Wed, 25 May 2016 11:15:25 -0400	[thread overview]
Message-ID: <20160525151525.GB4546@flamenco> (raw)
In-Reply-To: <1464179166-24137-1-git-send-email-pbonzini@redhat.com>

On Wed, May 25, 2016 at 14:26:06 +0200, Paolo Bonzini wrote:
> Over time, some differences between QEMU and Linux atomics are getting
> smoothed.  In particular, Linux grew atomic_fetch_or (and in general
> the differences regarding RMW operations were not described accurately)
> and smp_load_acquire/smp_store_release.  Also, set_mb was renamed to
> smp_store_mb().  Include these changes in the documentation.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/atomics.txt | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/docs/atomics.txt b/docs/atomics.txt
> index 67a27ad..3f8b770 100644
> --- a/docs/atomics.txt
> +++ b/docs/atomics.txt
> @@ -340,17 +340,27 @@ and memory barriers, and the equivalents in QEMU:
>    properly aligned.
>    No barriers are implied by atomic_read/set in either Linux or QEMU.
>  
> -- most atomic read-modify-write operations in Linux return void;
> -  in QEMU, all of them return the old value of the variable.
> +- atomic read-modify-write operations in Linux are of three kinds:
> +
> +         atomic_OP          returns void
> +         atomic_OP_return   returns new value of the variable
> +         atomic_fetch_OP    returns the old value of the variable
> +         atomic_cmpxchg     returns the old value of the variable
> +
> +  In QEMU, the second kind does not exist.  Currently Linux has
> +  atomic_fetch_or only; QEMU provides all of inc, dec, and, sub, and, or.

Not clear whether the last 'and' is redundant or is being used as
a conjunction. Either way it would be clearer to just remove it.

Other than that:
  Reviewed-by: Emilio G. Cota <cota@braap.org>

		Emilio

  reply	other threads:[~2016-05-25 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 12:26 [Qemu-devel] [PATCH] docs/atomics: update comparison with Linux Paolo Bonzini
2016-05-25 15:15 ` Emilio G. Cota [this message]
2016-05-25 15:29   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160525151525.GB4546@flamenco \
    --to=cota@braap.org \
    --cc=mttcg@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).