From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5UXy-00027R-1N for qemu-devel@nongnu.org; Wed, 25 May 2016 04:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5UXt-0004Fz-UE for qemu-devel@nongnu.org; Wed, 25 May 2016 04:52:09 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5UXt-0004Ft-FM for qemu-devel@nongnu.org; Wed, 25 May 2016 04:52:05 -0400 Received: by mail-wm0-x22a.google.com with SMTP id n129so169636259wmn.1 for ; Wed, 25 May 2016 01:52:04 -0700 (PDT) References: <1463863336-28760-1-git-send-email-cota@braap.org> <1463863336-28760-2-git-send-email-cota@braap.org> <20160523170912.GA16390@flamenco> <20160524195609.GA30809@flamenco> <5744B2BD.5000705@gmail.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <5744B2BD.5000705@gmail.com> Date: Wed, 25 May 2016 09:52:41 +0100 Message-ID: <87y46ycyee.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov Cc: "Emilio G. Cota" , Paolo Bonzini , Richard Henderson , MTTCG Devel , QEMU Developers Sergey Fedorov writes: > On 24/05/16 22:56, Emilio G. Cota wrote: >> On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: >>> On 23/05/2016 19:09, Emilio G. Cota wrote: >>>> PS. And really equating smp_wmb/rmb to release/acquire as we have under >>>> #ifdef __ATOMIC is hard to justify, other than to please tsan. >>> That only makes a difference on arm64, right? >>> >>> acquire release rmb wmb >>> x86 -- -- -- -- >>> power lwsync lwsync lwsync lwsync >>> armv7 dmb dmb dmb dmb >>> arm64 dmb ishld dmb ish dmb ishld dmb ishst >>> ia64 -- -- -- -- >> Yes. I now see why we're defining rmb/wmb based on acquire/release: >> it's quite convenient given that the compiler provides them, and >> the (tiny) differences in practice are not worth the trouble of >> adding asm for them. So I take back my comment =) >> >> The gains of getting rid of the consume barrier from atomic_rcu_read >> are clear though; updated patch to follow. > > However, maybe it's not such a pain to maintain an optimized version for > AArch64 in assembly :P Please don't. The advantage of the builtins is they are known by things like tsan. > > Best, > Sergey -- Alex Bennée