From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5aWx-0001kL-8t for qemu-devel@nongnu.org; Wed, 25 May 2016 11:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5aWu-000199-31 for qemu-devel@nongnu.org; Wed, 25 May 2016 11:15:31 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5aWt-00018M-UL for qemu-devel@nongnu.org; Wed, 25 May 2016 11:15:28 -0400 Date: Wed, 25 May 2016 11:15:25 -0400 From: "Emilio G. Cota" Message-ID: <20160525151525.GB4546@flamenco> References: <1464179166-24137-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464179166-24137-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] docs/atomics: update comparison with Linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mttcg@greensocs.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 > --- > 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 Emilio