From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Parri Subject: Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo Date: Wed, 20 Feb 2019 14:17:30 +0100 Message-ID: <20190220131730.GB3215@andrea> References: <1550617057-4911-1-git-send-email-andrea.parri@amarulasolutions.com> <20190220020117.GD11787@linux.ibm.com> <20190220092604.GD32494@hirez.programming.kicks-ass.net> <20190220095659.GA17578@brain-police> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190220095659.GA17578@brain-police> Sender: linux-kernel-owner@vger.kernel.org To: Will Deacon Cc: Peter Zijlstra , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Alan Stern , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig List-Id: linux-arch.vger.kernel.org On Wed, Feb 20, 2019 at 09:57:00AM +0000, Will Deacon wrote: > On Wed, Feb 20, 2019 at 10:26:04AM +0100, Peter Zijlstra wrote: > > On Tue, Feb 19, 2019 at 06:01:17PM -0800, Paul E. McKenney wrote: > > > On Tue, Feb 19, 2019 at 11:57:37PM +0100, Andrea Parri wrote: > > > > Remove this subtle (and, AFAICT, unused) ordering: we can add it back, > > > > if necessary, but let us not encourage people to rely on this thing. > > > > > > > > For example, the following "exists" clause can be satisfied with this > > > > change: > > > > > > > > C dep-rfi > > > > > > > > { } > > > > > > > > P0(int *x, int *y) > > > > { > > > > WRITE_ONCE(*x, 1); > > > > smp_store_release(y, 1); > > > > } > > > > > > > > P1(int *x, int *y, int *z) > > > > { > > > > int r0; > > > > int r1; > > > > int r2; > > > > > > > > r0 = READ_ONCE(*y); > > > > WRITE_ONCE(*z, r0); > > > > r1 = smp_load_acquire(z); > > > > r2 = READ_ONCE(*x); > > > > } > > > > > > > > exists (1:r0=1 /\ 1:r2=0) > > > > > > Any objections? If I don't hear any in a couple days, I will apply this. > > > > IIUC you cannot build hardware that allows the above, so why would we > > allow it? > > Agreed. Maybe the intention was to make the dependency between the read of > *y and the write of *z on P1 a control dependency instead? That's certainly > allowed on arm64. No no, I did mean dep (= addr | data). As you remarked, control dep. aren't going to work here. I expanded on this in my reply to peterz. Andrea > > Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:37936 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfBTNRu (ORCPT ); Wed, 20 Feb 2019 08:17:50 -0500 Received: by mail-wr1-f67.google.com with SMTP id v13so25914328wrw.5 for ; Wed, 20 Feb 2019 05:17:49 -0800 (PST) Date: Wed, 20 Feb 2019 14:17:30 +0100 From: Andrea Parri Subject: Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo Message-ID: <20190220131730.GB3215@andrea> References: <1550617057-4911-1-git-send-email-andrea.parri@amarulasolutions.com> <20190220020117.GD11787@linux.ibm.com> <20190220092604.GD32494@hirez.programming.kicks-ass.net> <20190220095659.GA17578@brain-police> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220095659.GA17578@brain-police> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Will Deacon Cc: Peter Zijlstra , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Alan Stern , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig Message-ID: <20190220131730._LQtZfmdD4AiL0JkLdjmOZ7PmQnar86STjnvkbtopNs@z> On Wed, Feb 20, 2019 at 09:57:00AM +0000, Will Deacon wrote: > On Wed, Feb 20, 2019 at 10:26:04AM +0100, Peter Zijlstra wrote: > > On Tue, Feb 19, 2019 at 06:01:17PM -0800, Paul E. McKenney wrote: > > > On Tue, Feb 19, 2019 at 11:57:37PM +0100, Andrea Parri wrote: > > > > Remove this subtle (and, AFAICT, unused) ordering: we can add it back, > > > > if necessary, but let us not encourage people to rely on this thing. > > > > > > > > For example, the following "exists" clause can be satisfied with this > > > > change: > > > > > > > > C dep-rfi > > > > > > > > { } > > > > > > > > P0(int *x, int *y) > > > > { > > > > WRITE_ONCE(*x, 1); > > > > smp_store_release(y, 1); > > > > } > > > > > > > > P1(int *x, int *y, int *z) > > > > { > > > > int r0; > > > > int r1; > > > > int r2; > > > > > > > > r0 = READ_ONCE(*y); > > > > WRITE_ONCE(*z, r0); > > > > r1 = smp_load_acquire(z); > > > > r2 = READ_ONCE(*x); > > > > } > > > > > > > > exists (1:r0=1 /\ 1:r2=0) > > > > > > Any objections? If I don't hear any in a couple days, I will apply this. > > > > IIUC you cannot build hardware that allows the above, so why would we > > allow it? > > Agreed. Maybe the intention was to make the dependency between the read of > *y and the write of *z on P1 a control dependency instead? That's certainly > allowed on arm64. No no, I did mean dep (= addr | data). As you remarked, control dep. aren't going to work here. I expanded on this in my reply to peterz. Andrea > > Will