Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Paul E. McKenney
On Tue, Feb 16, 2016 at 10:59:08AM -0800, Linus Torvalds wrote: > On Mon, Feb 15, 2016 at 9:58 AM, Paul E. McKenney > wrote: > > > > Two threads: > > > > int a, b; > > > > void thread0(void) > > { > > WRITE_ONCE(a, 1); > >

Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Linus Torvalds
On Mon, Feb 15, 2016 at 9:58 AM, Paul E. McKenney wrote: > > Two threads: > > int a, b; > > void thread0(void) > { > WRITE_ONCE(a, 1); > smp_wmb(); > WRITE_ONCE(b, 2); > } > > void

Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Paul E. McKenney
On Tue, Feb 16, 2016 at 09:53:20AM +, Will Deacon wrote: > On Mon, Feb 15, 2016 at 12:35:12PM -0800, Paul E. McKenney wrote: > > On Mon, Feb 15, 2016 at 06:58:32PM +, Will Deacon wrote: > > > On Mon, Feb 15, 2016 at 09:58:25AM -0800, Paul E. McKenney wrote: > > > > Some architectures

Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Will Deacon
On Mon, Feb 15, 2016 at 12:35:12PM -0800, Paul E. McKenney wrote: > On Mon, Feb 15, 2016 at 06:58:32PM +, Will Deacon wrote: > > On Mon, Feb 15, 2016 at 09:58:25AM -0800, Paul E. McKenney wrote: > > > Some architectures provide local transitivity for a chain of threads doing > > > writes

Re: Writes, smp_wmb(), and transitivity?

2016-02-15 Thread Paul E. McKenney
On Mon, Feb 15, 2016 at 06:58:32PM +, Will Deacon wrote: > On Mon, Feb 15, 2016 at 09:58:25AM -0800, Paul E. McKenney wrote: > > Hello! > > Hi Paul, > > > Some architectures provide local transitivity for a chain of threads doing > > writes separated by smp_wmb(), as exemplified by the

Re: Writes, smp_wmb(), and transitivity?

2016-02-15 Thread Will Deacon
On Mon, Feb 15, 2016 at 09:58:25AM -0800, Paul E. McKenney wrote: > Hello! Hi Paul, > Some architectures provide local transitivity for a chain of threads doing > writes separated by smp_wmb(), as exemplified by the litmus tests below. > The pattern is that each thread writes to a its own

Writes, smp_wmb(), and transitivity?

2016-02-15 Thread Paul E. McKenney
Hello! Some architectures provide local transitivity for a chain of threads doing writes separated by smp_wmb(), as exemplified by the litmus tests below. The pattern is that each thread writes to a its own variable, does an smp_wmb(), then writes a different value to the next thread's variable.