Re: Question on smp_mb__before_spinlock

2016-09-12 Thread Nicholas Piggin
On Mon, 12 Sep 2016 14:54:03 +0200 Peter Zijlstra wrote: > On Mon, Sep 12, 2016 at 12:27:08PM +1000, Nicholas Piggin wrote: > > On Wed, 7 Sep 2016 15:23:54 +0200 > > Peter Zijlstra wrote: > > > > Interesting idea.. > > > > > > So I'm not a fan of

Re: Question on smp_mb__before_spinlock

2016-09-12 Thread Nicholas Piggin
On Mon, 12 Sep 2016 14:54:03 +0200 Peter Zijlstra wrote: > On Mon, Sep 12, 2016 at 12:27:08PM +1000, Nicholas Piggin wrote: > > On Wed, 7 Sep 2016 15:23:54 +0200 > > Peter Zijlstra wrote: > > > > Interesting idea.. > > > > > > So I'm not a fan of that raw_spin_lock wrapper, since that would

Re: Question on smp_mb__before_spinlock

2016-09-12 Thread Peter Zijlstra
On Mon, Sep 12, 2016 at 12:27:08PM +1000, Nicholas Piggin wrote: > On Wed, 7 Sep 2016 15:23:54 +0200 > Peter Zijlstra wrote: > > Interesting idea.. > > > > So I'm not a fan of that raw_spin_lock wrapper, since that would end up > > with a lot more boiler-plate code than

Re: Question on smp_mb__before_spinlock

2016-09-12 Thread Peter Zijlstra
On Mon, Sep 12, 2016 at 12:27:08PM +1000, Nicholas Piggin wrote: > On Wed, 7 Sep 2016 15:23:54 +0200 > Peter Zijlstra wrote: > > Interesting idea.. > > > > So I'm not a fan of that raw_spin_lock wrapper, since that would end up > > with a lot more boiler-plate code than just the one extra

Re: Question on smp_mb__before_spinlock

2016-09-11 Thread Nicholas Piggin
On Wed, 7 Sep 2016 14:51:47 +0100 Will Deacon wrote: > On Wed, Sep 07, 2016 at 03:23:54PM +0200, Peter Zijlstra wrote: > > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > > It seems okay, but why not make it a special sched-only function name > > > to

Re: Question on smp_mb__before_spinlock

2016-09-11 Thread Nicholas Piggin
On Wed, 7 Sep 2016 14:51:47 +0100 Will Deacon wrote: > On Wed, Sep 07, 2016 at 03:23:54PM +0200, Peter Zijlstra wrote: > > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > > It seems okay, but why not make it a special sched-only function name > > > to prevent it being used

Re: Question on smp_mb__before_spinlock

2016-09-11 Thread Nicholas Piggin
On Wed, 7 Sep 2016 15:23:54 +0200 Peter Zijlstra wrote: > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > > /* > > > + * This barrier must provide two things: > > > + * > > > + * - it must guarantee a STORE before the spin_lock() is ordered > > >

Re: Question on smp_mb__before_spinlock

2016-09-11 Thread Nicholas Piggin
On Wed, 7 Sep 2016 15:23:54 +0200 Peter Zijlstra wrote: > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > > /* > > > + * This barrier must provide two things: > > > + * > > > + * - it must guarantee a STORE before the spin_lock() is ordered > > > against a > > > + *

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Will Deacon
On Wed, Sep 07, 2016 at 03:23:54PM +0200, Peter Zijlstra wrote: > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > It seems okay, but why not make it a special sched-only function name > > to prevent it being used in generic code? > > > > I would not mind seeing responsibility

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Will Deacon
On Wed, Sep 07, 2016 at 03:23:54PM +0200, Peter Zijlstra wrote: > On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > It seems okay, but why not make it a special sched-only function name > > to prevent it being used in generic code? > > > > I would not mind seeing responsibility

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Peter Zijlstra
On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > /* > > + * This barrier must provide two things: > > + * > > + * - it must guarantee a STORE before the spin_lock() is ordered against > > a > > + * LOAD after it, see the comments at its two usage sites. > > + * > > + *

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Peter Zijlstra
On Wed, Sep 07, 2016 at 10:17:26PM +1000, Nicholas Piggin wrote: > > /* > > + * This barrier must provide two things: > > + * > > + * - it must guarantee a STORE before the spin_lock() is ordered against > > a > > + * LOAD after it, see the comments at its two usage sites. > > + * > > + *

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Nicholas Piggin
On Mon, 5 Sep 2016 11:37:53 +0200 Peter Zijlstra wrote: > Hi all, > > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat.

Re: Question on smp_mb__before_spinlock

2016-09-07 Thread Nicholas Piggin
On Mon, 5 Sep 2016 11:37:53 +0200 Peter Zijlstra wrote: > Hi all, > > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat. Also, I wonder if, with

Re: Question on smp_mb__before_spinlock

2016-09-06 Thread Will Deacon
On Tue, Sep 06, 2016 at 01:17:53PM +0200, Peter Zijlstra wrote: > On Mon, Sep 05, 2016 at 11:10:22AM +0100, Will Deacon wrote: > > > > The second issue I wondered about is spinlock transitivity. All except > > > powerpc have RCsc locks, and since Power already does a full mb, would > > > it not

Re: Question on smp_mb__before_spinlock

2016-09-06 Thread Will Deacon
On Tue, Sep 06, 2016 at 01:17:53PM +0200, Peter Zijlstra wrote: > On Mon, Sep 05, 2016 at 11:10:22AM +0100, Will Deacon wrote: > > > > The second issue I wondered about is spinlock transitivity. All except > > > powerpc have RCsc locks, and since Power already does a full mb, would > > > it not

Re: Question on smp_mb__before_spinlock

2016-09-06 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 11:10:22AM +0100, Will Deacon wrote: > > The second issue I wondered about is spinlock transitivity. All except > > powerpc have RCsc locks, and since Power already does a full mb, would > > it not make sense to put it _after_ the spin_lock(), which would provide > > the

Re: Question on smp_mb__before_spinlock

2016-09-06 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 11:10:22AM +0100, Will Deacon wrote: > > The second issue I wondered about is spinlock transitivity. All except > > powerpc have RCsc locks, and since Power already does a full mb, would > > it not make sense to put it _after_ the spin_lock(), which would provide > > the

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Paul E. McKenney
On Mon, Sep 05, 2016 at 01:34:35PM +0200, Peter Zijlstra wrote: > On Mon, Sep 05, 2016 at 03:37:14AM -0700, Paul E. McKenney wrote: > > On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > > > Hi all, > > > > > > So recently I've had two separate issues that touched upon > > >

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Paul E. McKenney
On Mon, Sep 05, 2016 at 01:34:35PM +0200, Peter Zijlstra wrote: > On Mon, Sep 05, 2016 at 03:37:14AM -0700, Paul E. McKenney wrote: > > On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > > > Hi all, > > > > > > So recently I've had two separate issues that touched upon > > >

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 03:37:14AM -0700, Paul E. McKenney wrote: > On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > > Hi all, > > > > So recently I've had two separate issues that touched upon > > smp_mb__before_spinlock(). > > > > > > Since its inception, our understanding of

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 03:37:14AM -0700, Paul E. McKenney wrote: > On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > > Hi all, > > > > So recently I've had two separate issues that touched upon > > smp_mb__before_spinlock(). > > > > > > Since its inception, our understanding of

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Fengguang Wu
Hi Peter, On Mon, Sep 05, 2016 at 12:19:37PM +0200, Peter Zijlstra wrote: On Mon, Sep 05, 2016 at 05:56:46PM +0800, kbuild test robot wrote: Hi Peter, [auto build test ERROR on linus/master] [also build test ERROR on v4.8-rc5 next-20160825] [if your patch is applied to the wrong git tree,

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Fengguang Wu
Hi Peter, On Mon, Sep 05, 2016 at 12:19:37PM +0200, Peter Zijlstra wrote: On Mon, Sep 05, 2016 at 05:56:46PM +0800, kbuild test robot wrote: Hi Peter, [auto build test ERROR on linus/master] [also build test ERROR on v4.8-rc5 next-20160825] [if your patch is applied to the wrong git tree,

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread kbuild test robot
ord what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Peter-Zijlstra/Question-on-smp_mb__before_spinlock/20160905-174026 config: i386-randconfig-s1-201636 (attac

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread kbuild test robot
ord what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Peter-Zijlstra/Question-on-smp_mb__before_spinlock/20160905-174026 config: i386-randconfig-s1-201636 (attac

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Paul E. McKenney
On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > Hi all, > > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat. Also, I wonder if,

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Paul E. McKenney
On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > Hi all, > > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat. Also, I wonder if,

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 05:56:46PM +0800, kbuild test robot wrote: > Hi Peter, > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.8-rc5 next-20160825] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > [Suggest to use

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
On Mon, Sep 05, 2016 at 05:56:46PM +0800, kbuild test robot wrote: > Hi Peter, > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.8-rc5 next-20160825] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > [Suggest to use

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Will Deacon
On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat. Also, I wonder if, with a

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread Will Deacon
On Mon, Sep 05, 2016 at 11:37:53AM +0200, Peter Zijlstra wrote: > So recently I've had two separate issues that touched upon > smp_mb__before_spinlock(). > > > Since its inception, our understanding of ACQUIRE, esp. as applied to > spinlocks, has changed somewhat. Also, I wonder if, with a

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread kbuild test robot
ord what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Peter-Zijlstra/Question-on-smp_mb__before_spinlock/20160905-174026 config: x86_64-randconfig-x013-201636 (attac

Re: Question on smp_mb__before_spinlock

2016-09-05 Thread kbuild test robot
ord what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Peter-Zijlstra/Question-on-smp_mb__before_spinlock/20160905-174026 config: x86_64-randconfig-x013-201636 (attac

Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
Hi all, So recently I've had two separate issues that touched upon smp_mb__before_spinlock(). Since its inception, our understanding of ACQUIRE, esp. as applied to spinlocks, has changed somewhat. Also, I wonder if, with a simple change, we cannot make it provide more. The problem with the

Question on smp_mb__before_spinlock

2016-09-05 Thread Peter Zijlstra
Hi all, So recently I've had two separate issues that touched upon smp_mb__before_spinlock(). Since its inception, our understanding of ACQUIRE, esp. as applied to spinlocks, has changed somewhat. Also, I wonder if, with a simple change, we cannot make it provide more. The problem with the