Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbaBXQ1b (ORCPT ); Mon, 24 Feb 2014 11:27:31 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:56771 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbaBXQ12 (ORCPT ); Mon, 24 Feb 2014 11:27:28 -0500 MIME-Version: 1.0 In-Reply-To: References: <20140220083032.GN4250@linux.vnet.ibm.com> <20140220181116.GT4250@linux.vnet.ibm.com> <1392922421.28840.36.camel@triegel.csb> <1393095223.28840.4914.camel@triegel.csb> <20140223003933.GQ4250@linux.vnet.ibm.com> <20140223063426.GT4250@linux.vnet.ibm.com> Date: Mon, 24 Feb 2014 17:27:26 +0100 Message-ID: Subject: Re: [RFC][PATCH 0/5] arch: atomic rework From: Richard Biener To: Linus Torvalds Cc: Paul McKenney , Torvald Riegel , Will Deacon , Peter Zijlstra , Ramana Radhakrishnan , David Howells , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "mingo@kernel.org" , "gcc@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2014 at 4:57 PM, Linus Torvalds wrote: > On Sun, Feb 23, 2014 at 11:31 AM, Linus Torvalds > wrote: >> >> Let me think about it some more, but my gut feel is that just tweaking >> the definition of what "ordered" means is sufficient. >> >> So to go back to the suggested ordering rules (ignoring the "restrict" >> part, which is just to clarify that ordering through other means to >> get to the object doesn't matter), I suggested: >> >> "the consume ordering guarantees the ordering between that >> atomic read and the accesses to the object that the pointer >> points to" >> >> and I think the solution is to just say that this ordering acts as a >> fence. It doesn't say exactly *where* the fence is, but it says that >> there is *some* fence between the load of the pointer and any/all >> accesses to the object through that pointer. > > I'm wrong. That doesn't work. At all. There is no ordering except > through the pointer chain. > > So I think saying just that, and nothing else (no magic fences, no > nothing) is the right thing: > > "the consume ordering guarantees the ordering between that > atomic read and the accesses to the object that the pointer > points to directly or indirectly through a chain of pointers" To me that reads like int i; int *q = &i; int **p = &q; atomic_XXX (p, CONSUME); orders against accesses '*p', '**p', '*q' and 'i'. Thus it seems they want to say that it orders against aliased storage - but then go further and include "indirectly through a chain of pointers"?! Thus an atomic read of a int * orders against any 'int' memory operation but not against 'float' memory operations? Eh ... Just jumping in to throw in my weird-2-cents. Richard. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/