Received: from eggs.gnu.org ([2001:4830:134:3::10]:53692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btdbA-00038n-Th for qemu-devel@nongnu.org; Mon, 10 Oct 2016 12:38:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btdb7-0007KA-GA for qemu-devel@nongnu.org; Mon, 10 Oct 2016 12:38:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btdb7-0007Jz-9U for qemu-devel@nongnu.org; Mon, 10 Oct 2016 12:38:41 -0400 References: <1476107947-31430-1-git-send-email-pbonzini@redhat.com> <1476107947-31430-2-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <25ae81bf-9791-b364-a5aa-bc85fbfd321a@redhat.com> Date: Mon, 10 Oct 2016 18:38:37 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/5] atomic: introduce smp_mb_acquire and smp_mb_release List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: cota@braap.org, alex.bennee@linaro.org On 10/10/2016 17:29, Eric Blake wrote: > On 10/10/2016 08:59 AM, Paolo Bonzini wrote: >> Signed-off-by: Paolo Bonzini >> --- >> docs/atomics.txt | 79 ++++++++++++++++++++++++++++++------------= --------- >> include/qemu/atomic.h | 50 +++++++++++++++++++------------- >> 2 files changed, 77 insertions(+), 52 deletions(-) >> >=20 >> =20 >> +- smp_mb_acquire() guarantees that all the LOAD operations specified = before >> + the barrier will appear to happen before all the LOAD or STORE oper= ations >> + specified after the barrier with respect to the other components of >> + the system. >> + >> +- smp_mb_release() guarantees that all the STORE operations specified= *after* >> + the barrier will appear to happen before all the LOAD or STORE oper= ations >=20 > Sounds impossible. Should this be 'will appear to happen after all'? Yes, of course. Damn copy and paste... Paolo >> + specified *before* the barrier with respect to the other components= of >> + the system. >> + >> - smp_mb() guarantees that all the LOAD and STORE operations specifie= d >> before the barrier will appear to happen before all the LOAD and >> STORE operations specified after the barrier with respect to the ot= her >> @@ -149,8 +160,9 @@ They come in four kinds: >=20 >=20