From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758046AbdKOSFn (ORCPT ); Wed, 15 Nov 2017 13:05:43 -0500 Received: from foss.arm.com ([217.140.101.70]:43092 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757836AbdKOSFd (ORCPT ); Wed, 15 Nov 2017 13:05:33 -0500 Date: Wed, 15 Nov 2017 18:05:41 +0000 From: Will Deacon To: Alan Stern Cc: Peter Zijlstra , "Reshetova, Elena" , "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "keescook@chromium.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "ishkamiel@gmail.com" , Paul McKenney , parri.andrea@gmail.com, boqun.feng@gmail.com, dhowells@redhat.com, david@fromorbit.com Subject: Re: [PATCH] refcount: provide same memory ordering guarantees as in atomic_t Message-ID: <20171115180540.GQ19071@arm.com> References: <20171102171644.GD595@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2017 at 04:21:56PM -0400, Alan Stern wrote: > I was trying to think of something completely different. If you have a > release/acquire to the same address, it creates a happens-before > ordering: > > Access x > Release a > Acquire a > Access y > > Here is the access to x happens-before the access to y. This is true > even on x86, even in the presence of forwarding -- the CPU still has to > execute the instructions in order. But if the release and acquire are > to different addresses: > > Access x > Release a > Acquire b > Access y > > then there is no happens-before ordering for x and y -- the CPU can > execute the last two instructions before the first two. x86 and > PowerPC won't do this, but I believe ARMv8 can. (Please correct me if > it can't.) Release/Acquire are RCsc on ARMv8, so they are ordered irrespective of address. Will