From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbJSKXg (ORCPT ); Mon, 19 Oct 2015 06:23:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40633 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbbJSKXe (ORCPT ); Mon, 19 Oct 2015 06:23:34 -0400 Date: Mon, 19 Oct 2015 12:23:24 +0200 From: Peter Zijlstra To: Boqun Feng Cc: Will Deacon , "Paul E. McKenney" , Michael Ellerman , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Anton Blanchard , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Message-ID: <20151019102324.GO3816@twins.programming.kicks-ass.net> References: <1444215568-24732-1-git-send-email-will.deacon@arm.com> <20151007111915.GF17308@twins.programming.kicks-ass.net> <20151007132317.GK16065@arm.com> <20151007152501.GI3910@linux.vnet.ibm.com> <1444276236.9940.5.camel@ellerman.id.au> <20151008111638.GL3816@twins.programming.kicks-ass.net> <20151008214439.GE3910@linux.vnet.ibm.com> <20151009083138.GU3816@twins.programming.kicks-ass.net> <20151009094039.GD26278@arm.com> <20151019011718.GB924@fixme-laptop.cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151019011718.GB924@fixme-laptop.cn.ibm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2015 at 09:17:18AM +0800, Boqun Feng wrote: > This is confusing me right now. ;-) > > Let's use a simple example for only one primitive, as I understand it, > if we say a primitive A is "fully ordered", we actually mean: > > 1. The memory operations preceding(in program order) A can't be > reordered after the memory operations following(in PO) A. > > and > > 2. The memory operation(s) in A can't be reordered before the > memory operations preceding(in PO) A and after the memory > operations following(in PO) A. > > If we say A is a "full barrier", we actually means: > > 1. The memory operations preceding(in program order) A can't be > reordered after the memory operations following(in PO) A. > > and > > 2. The memory ordering guarantee in #1 is visible globally. > > Is that correct? Or "full barrier" is more strong than I understand, > i.e. there is a third property of "full barrier": > > 3. The memory operation(s) in A can't be reordered before the > memory operations preceding(in PO) A and after the memory > operations following(in PO) A. > > IOW, is "full barrier" a more strong version of "fully ordered" or not? Yes, that was how I used it. Now of course; the big question is do we want to promote this usage or come up with a different set of words describing this stuff. I think separating the ordering from the transitivity is useful, for we can then talk about and specify them independently. That is, we can say: LOAD-ACQUIRE: orders LOAD->{LOAD,STORE} weak transitivity (RCpc) MB: orders {LOAD,STORE}->{LOAD,STORE} (fully ordered) strong transitivity (RCsc) etc.. Also, in the above I used weak and strong transitivity, but that too is of course up for grabs.