Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 03:48:38PM +0100, Peter Zijlstra wrote: > On Thu, Feb 25, 2016 at 06:07:03AM -0800, Paul E. McKenney wrote: > > Still bad wording... > > > > It hasn't actually moved anything over the barrier(). It has instead > > moved both the barrier() and the WRITE_ONCE(b, p) to

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 03:48:38PM +0100, Peter Zijlstra wrote: > On Thu, Feb 25, 2016 at 06:07:03AM -0800, Paul E. McKenney wrote: > > Still bad wording... > > > > It hasn't actually moved anything over the barrier(). It has instead > > moved both the barrier() and the WRITE_ONCE(b, p) to

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Peter Zijlstra
On Thu, Feb 25, 2016 at 06:07:03AM -0800, Paul E. McKenney wrote: > Still bad wording... > > It hasn't actually moved anything over the barrier(). It has instead > moved both the barrier() and the WRITE_ONCE(b, p) to precede the "if > (q)". Mathieu mentioned this over IRC yesterday, and I queue

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Peter Zijlstra
On Thu, Feb 25, 2016 at 06:07:03AM -0800, Paul E. McKenney wrote: > Still bad wording... > > It hasn't actually moved anything over the barrier(). It has instead > moved both the barrier() and the WRITE_ONCE(b, p) to precede the "if > (q)". Mathieu mentioned this over IRC yesterday, and I queue

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 02:41:07PM +0800, Jianyu Zhan wrote: > On Thu, Feb 25, 2016 at 5:40 AM, Paul E. McKenney > wrote: > > So ordering between the read from "a" and the write to "b" is still > > preserved. The reason this works is that the smp_mb() does all the > >

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 02:41:07PM +0800, Jianyu Zhan wrote: > On Thu, Feb 25, 2016 at 5:40 AM, Paul E. McKenney > wrote: > > So ordering between the read from "a" and the write to "b" is still > > preserved. The reason this works is that the smp_mb() does all the > > ordering, so the fact that

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 09:21:43AM +0100, Peter Zijlstra wrote: > On Wed, Feb 24, 2016 at 01:40:13PM -0800, Paul E. McKenney wrote: > > > > + (*) If both legs of the "if" statement begin with identical stores to > > > > + the same variable, then those stores must be ordered, either by > > >

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Paul E. McKenney
On Thu, Feb 25, 2016 at 09:21:43AM +0100, Peter Zijlstra wrote: > On Wed, Feb 24, 2016 at 01:40:13PM -0800, Paul E. McKenney wrote: > > > > + (*) If both legs of the "if" statement begin with identical stores to > > > > + the same variable, then those stores must be ordered, either by > > >

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Peter Zijlstra
On Wed, Feb 24, 2016 at 01:40:13PM -0800, Paul E. McKenney wrote: > > > + (*) If both legs of the "if" statement begin with identical stores to > > > + the same variable, then those stores must be ordered, either by > > > + preceding both of them with smp_mb() or by using > > >

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-25 Thread Peter Zijlstra
On Wed, Feb 24, 2016 at 01:40:13PM -0800, Paul E. McKenney wrote: > > > + (*) If both legs of the "if" statement begin with identical stores to > > > + the same variable, then those stores must be ordered, either by > > > + preceding both of them with smp_mb() or by using > > >

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Jianyu Zhan
On Thu, Feb 25, 2016 at 5:40 AM, Paul E. McKenney wrote: > So ordering between the read from "a" and the write to "b" is still > preserved. The reason this works is that the smp_mb() does all the > ordering, so the fact that the control dependency has been eliminated

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Jianyu Zhan
On Thu, Feb 25, 2016 at 5:40 AM, Paul E. McKenney wrote: > So ordering between the read from "a" and the write to "b" is still > preserved. The reason this works is that the smp_mb() does all the > ordering, so the fact that the control dependency has been eliminated > is irrelevant. Thanks,

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Paul E. McKenney
On Wed, Feb 24, 2016 at 09:12:04PM +, Mathieu Desnoyers wrote: > - On Feb 24, 2016, at 12:00 AM, Paul E. McKenney > paul...@linux.vnet.ibm.com wrote: > > > The summary of the "CONTROL DEPENDENCIES" section incorrectly states that > > barrier() may be used to prevent compiler reordering

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Paul E. McKenney
On Wed, Feb 24, 2016 at 09:12:04PM +, Mathieu Desnoyers wrote: > - On Feb 24, 2016, at 12:00 AM, Paul E. McKenney > paul...@linux.vnet.ibm.com wrote: > > > The summary of the "CONTROL DEPENDENCIES" section incorrectly states that > > barrier() may be used to prevent compiler reordering

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Mathieu Desnoyers
- On Feb 24, 2016, at 12:00 AM, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: > The summary of the "CONTROL DEPENDENCIES" section incorrectly states that > barrier() may be used to prevent compiler reordering when more than one > leg of the control-dependent "if" statement start with

Re: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-24 Thread Mathieu Desnoyers
- On Feb 24, 2016, at 12:00 AM, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: > The summary of the "CONTROL DEPENDENCIES" section incorrectly states that > barrier() may be used to prevent compiler reordering when more than one > leg of the control-dependent "if" statement start with

[PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-23 Thread Paul E. McKenney
The summary of the "CONTROL DEPENDENCIES" section incorrectly states that barrier() may be used to prevent compiler reordering when more than one leg of the control-dependent "if" statement start with identical stores. This is incorrect at high optimization levels. This commit therefore updates

[PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores

2016-02-23 Thread Paul E. McKenney
The summary of the "CONTROL DEPENDENCIES" section incorrectly states that barrier() may be used to prevent compiler reordering when more than one leg of the control-dependent "if" statement start with identical stores. This is incorrect at high optimization levels. This commit therefore updates