Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-06 Thread Paul E. McKenney
On Wed, Mar 06, 2019 at 05:58:31PM +0100, Peter Zijlstra wrote: > On Thu, Mar 07, 2019 at 12:46:05AM +0900, Akira Yokosawa wrote: > > So, I'm looking at the macro RELOC_HIDE() defined in > > include/linux/compiler-gcc.h. > > > Am I the only one who was not aware of this gcc-specific macro? > >

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-06 Thread Paul E. McKenney
On Thu, Mar 07, 2019 at 12:46:05AM +0900, Akira Yokosawa wrote: > On Tue, 26 Feb 2019 16:04:50 +0100, Peter Zijlstra wrote: > > On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > > > >> Yes, this all is a bit on the insane side from a kernel viewpoint. > >> But the paper you

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-06 Thread Peter Zijlstra
On Thu, Mar 07, 2019 at 12:46:05AM +0900, Akira Yokosawa wrote: > So, I'm looking at the macro RELOC_HIDE() defined in > include/linux/compiler-gcc.h. > Am I the only one who was not aware of this gcc-specific macro? It's one I regularly see, but had forgotten about in this context. However;

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-06 Thread Akira Yokosawa
On Tue, 26 Feb 2019 16:04:50 +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > >> Yes, this all is a bit on the insane side from a kernel viewpoint. >> But the paper you found does not impose this; it has instead been there >> for about 20 years,

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-04 Thread Paul E. McKenney
On Sun, Mar 03, 2019 at 12:27:12AM +0900, Akira Yokosawa wrote: > Hello Peter, > > On Tue, 26 Feb 2019 14:49:06 +0100, Peter Zijlstra wrote: > > On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: > >> On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: > >>> When I used

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-03-02 Thread Akira Yokosawa
Hello Peter, On Tue, 26 Feb 2019 14:49:06 +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: >> On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: >>> When I used the argc variant, gcc-8 'works', but with s/argc/1/ it is >>> still broken.

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Paul E. McKenney
On Tue, Feb 26, 2019 at 03:47:30PM +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > > I must confess to not being all that sympathetic to code that takes > > advantage of happenstance stack-frame layout. Is there some reason > > we need that? > >

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Akira Yokosawa
On Tue, 26 Feb 2019 07:04:27 -0800, Paul E. McKenney wrote: > On Tue, Feb 26, 2019 at 11:56:57PM +0900, Akira Yokosawa wrote: >> Hi Paul, >> >> On Tue, 26 Feb 2019 06:28:45 -0800, Paul E. McKenney wrote: >>> On Tue, Feb 26, 2019 at 02:49:06PM +0100, Peter Zijlstra wrote: On Tue, Feb 26, 2019

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > Yes, this all is a bit on the insane side from a kernel viewpoint. > But the paper you found does not impose this; it has instead been there > for about 20 years, back before C and C++ admitted to the existence > of concurrency.

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Paul E. McKenney
On Tue, Feb 26, 2019 at 11:56:57PM +0900, Akira Yokosawa wrote: > Hi Paul, > > On Tue, 26 Feb 2019 06:28:45 -0800, Paul E. McKenney wrote: > > On Tue, Feb 26, 2019 at 02:49:06PM +0100, Peter Zijlstra wrote: > >> On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: > >>> On Tue, Feb

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Akira Yokosawa
Hi Paul, On Tue, 26 Feb 2019 06:28:45 -0800, Paul E. McKenney wrote: > On Tue, Feb 26, 2019 at 02:49:06PM +0100, Peter Zijlstra wrote: >> On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: >>> On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: When I used the argc

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > I must confess to not being all that sympathetic to code that takes > advantage of happenstance stack-frame layout. Is there some reason > we need that? Not that I'm aware; but if it gets this 'obvious' case wrong, I worry what

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Paul E. McKenney
On Tue, Feb 26, 2019 at 02:49:06PM +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: > > On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: > > > When I used the argc variant, gcc-8 'works', but with s/argc/1/ it is > > > still broken. > >

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 12:38:13PM +0100, Borislav Petkov wrote: > On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: > > When I used the argc variant, gcc-8 'works', but with s/argc/1/ it is > > still broken. > > As requested on IRC: What I asked was if you could get your GCC

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Borislav Petkov
On Tue, Feb 26, 2019 at 12:30:08PM +0100, Peter Zijlstra wrote: > When I used the argc variant, gcc-8 'works', but with s/argc/1/ it is > still broken. As requested on IRC: $ gcc --version gcc (SUSE Linux) 4.8.5 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 12:25:21PM +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 12:21:33PM +0100, Peter Zijlstra wrote: > > > Also; we need to find a GCC person to find/give us a knob to kill this > > entire class of nonsense. This is just horrible broken shit: > > > > > > ~/tmp# gcc

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 12:21:33PM +0100, Peter Zijlstra wrote: > Also; we need to find a GCC person to find/give us a knob to kill this > entire class of nonsense. This is just horrible broken shit: > > > ~/tmp# gcc -O2 -fno-strict-aliasing -o ptr ptr.c ; ./ptr > p=0x5635dd3d5034

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 11:45:51AM +0100, Peter Zijlstra wrote: > On Tue, Feb 26, 2019 at 10:30:09AM +0100, Peter Zijlstra wrote: > > On Mon, Feb 25, 2019 at 09:55:17AM -0800, Paul E. McKenney wrote: > > > But if you know of any code in the Linux kernel that needs to compare > > > pointers, one of

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 10:30:09AM +0100, Peter Zijlstra wrote: > On Mon, Feb 25, 2019 at 09:55:17AM -0800, Paul E. McKenney wrote: > > But if you know of any code in the Linux kernel that needs to compare > > pointers, one of which might be in the process of being freed, please > > do point me at

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Mon, Feb 25, 2019 at 09:55:17AM -0800, Paul E. McKenney wrote: > But if you know of any code in the Linux kernel that needs to compare > pointers, one of which might be in the process of being freed, please > do point me at it. I'm having the utmost difficulty of understanding why that would

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-26 Thread Peter Zijlstra
On Mon, Feb 25, 2019 at 09:55:17AM -0800, Paul E. McKenney wrote: > Again, if you know of any code in the Linux kernel that would have > problems with aggressive optimizations based on pointer provenance, > please let me know! I've no clue what pointer provenance is to begin with.

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-25 Thread Paul E. McKenney
On Fri, Feb 22, 2019 at 02:00:14PM +0100, Peter Zijlstra wrote: > On Fri, Feb 22, 2019 at 12:21:28PM +0100, Andrea Parri wrote: > > > What I do object to is a model that's weaker than any possible sane > > > hardware. > > > > Not the first time I hear you calling this out. And inevitably, every

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-22 Thread Peter Zijlstra
On Fri, Feb 22, 2019 at 12:21:28PM +0100, Andrea Parri wrote: > > What I do object to is a model that's weaker than any possible sane > > hardware. > > Not the first time I hear you calling this out. And inevitably, every > time, other slogans come to my mind: "C is not an assembly language",

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-22 Thread Andrea Parri
> What I do object to is a model that's weaker than any possible sane > hardware. Not the first time I hear you calling this out. And inevitably, every time, other slogans come to my mind: "C is not an assembly language", "No features (ordering) without users", ... For the record, I won't try

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Alan Stern
On Wed, 20 Feb 2019, Will Deacon wrote: > Whilst I completely agree that relying on the ordering provided by "dep ; > rfi" is subtle and error prone, having it forbid the outcome above appeals > to a hardware-based mindset of how memory ordering works. In the kernel > community, I would posit

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Alan Stern
On Tue, 19 Feb 2019, 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 > > { } >

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Will Deacon
On Wed, Feb 20, 2019 at 02:14:56PM +0100, Andrea Parri 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,

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Peter Zijlstra
On Wed, Feb 20, 2019 at 02:14:56PM +0100, Andrea Parri 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,

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Andrea Parri
On Wed, Feb 20, 2019 at 09:57:00AM +, 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,

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Andrea Parri
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

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Will Deacon
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

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-20 Thread Peter Zijlstra
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

Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-19 Thread Paul E. McKenney
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

[RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

2019-02-19 Thread Andrea Parri
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);