Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Waiman Long
On 04/23/2014 06:24 PM, Waiman Long wrote: On 04/23/2014 01:55 PM, Konrad Rzeszutek Wilk wrote: On Wed, Apr 23, 2014 at 01:43:58PM -0400, Waiman Long wrote: On 04/23/2014 10:56 AM, Konrad Rzeszutek Wilk wrote: On Wed, Apr 23, 2014 at 10:23:43AM -0400, Waiman Long wrote: On 04/18/2014 05:40 PM

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Waiman Long
On 04/23/2014 01:55 PM, Konrad Rzeszutek Wilk wrote: On Wed, Apr 23, 2014 at 01:43:58PM -0400, Waiman Long wrote: On 04/23/2014 10:56 AM, Konrad Rzeszutek Wilk wrote: On Wed, Apr 23, 2014 at 10:23:43AM -0400, Waiman Long wrote: On 04/18/2014 05:40 PM, Waiman Long wrote: On 04/18/2014 03:05 PM

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Konrad Rzeszutek Wilk
On Wed, Apr 23, 2014 at 01:43:58PM -0400, Waiman Long wrote: > On 04/23/2014 10:56 AM, Konrad Rzeszutek Wilk wrote: > >On Wed, Apr 23, 2014 at 10:23:43AM -0400, Waiman Long wrote: > >>On 04/18/2014 05:40 PM, Waiman Long wrote: > >>>On 04/18/2014 03:05 PM, Peter Zijlstra wrote: > On Fri, Apr 18,

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Waiman Long
On 04/23/2014 10:56 AM, Konrad Rzeszutek Wilk wrote: On Wed, Apr 23, 2014 at 10:23:43AM -0400, Waiman Long wrote: On 04/18/2014 05:40 PM, Waiman Long wrote: On 04/18/2014 03:05 PM, Peter Zijlstra wrote: On Fri, Apr 18, 2014 at 01:52:50PM -0400, Waiman Long wrote: I am confused by your notatio

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Konrad Rzeszutek Wilk
On Wed, Apr 23, 2014 at 10:23:43AM -0400, Waiman Long wrote: > On 04/18/2014 05:40 PM, Waiman Long wrote: > >On 04/18/2014 03:05 PM, Peter Zijlstra wrote: > >>On Fri, Apr 18, 2014 at 01:52:50PM -0400, Waiman Long wrote: > >>>I am confused by your notation. > >>Nah, I think I was confused :-) Make t

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-23 Thread Waiman Long
On 04/18/2014 05:40 PM, Waiman Long wrote: On 04/18/2014 03:05 PM, Peter Zijlstra wrote: On Fri, Apr 18, 2014 at 01:52:50PM -0400, Waiman Long wrote: I am confused by your notation. Nah, I think I was confused :-) Make the 1 _Q_LOCKED_VAL though, as that's the proper constant to use. Everyon

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-19 Thread Ingo Molnar
* Waiman Long wrote: > On 04/18/2014 03:46 AM, Ingo Molnar wrote: > >* Waiman Long wrote: > > > >>On 04/17/2014 11:58 AM, Peter Zijlstra wrote: > >>>On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > +static __always_inline void > +clear_pending_set_locked(struct qspinlock *

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Waiman Long
On 04/18/2014 03:05 PM, Peter Zijlstra wrote: On Fri, Apr 18, 2014 at 01:52:50PM -0400, Waiman Long wrote: I am confused by your notation. Nah, I think I was confused :-) Make the 1 _Q_LOCKED_VAL though, as that's the proper constant to use. Everyone gets confused once in a while:-) I have pl

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Peter Zijlstra
On Fri, Apr 18, 2014 at 01:52:50PM -0400, Waiman Long wrote: > I am confused by your notation. Nah, I think I was confused :-) Make the 1 _Q_LOCKED_VAL though, as that's the proper constant to use. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Waiman Long
On 04/18/2014 04:27 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 05:46:27PM -0400, Waiman Long wrote: On 04/17/2014 11:56 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: +struct __qspinlock { + union { + atomic_t val;

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Waiman Long
On 04/18/2014 03:46 AM, Ingo Molnar wrote: * Waiman Long wrote: On 04/17/2014 11:58 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: +static __always_inline void +clear_pending_set_locked(struct qspinlock *lock, u32 val) +{ + struct __qspinlock *l

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 05:46:27PM -0400, Waiman Long wrote: > On 04/17/2014 11:56 AM, Peter Zijlstra wrote: > >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > >>+struct __qspinlock { > >>+ union { > >>+ atomic_t val; char bytes[4]; > >>+ struc

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-18 Thread Ingo Molnar
* Waiman Long wrote: > On 04/17/2014 11:58 AM, Peter Zijlstra wrote: > >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > >>+static __always_inline void > >>+clear_pending_set_locked(struct qspinlock *lock, u32 val) > >>+{ > >>+ struct __qspinlock *l = (void *)lock; > >>+ > >>+

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Waiman Long
On 04/17/2014 11:58 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: +static __always_inline void +clear_pending_set_locked(struct qspinlock *lock, u32 val) +{ + struct __qspinlock *l = (void *)lock; + + ACCESS_ONCE(l->locked_pending) = 1; +} @@

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Waiman Long
On 04/17/2014 11:56 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: +struct __qspinlock { + union { + atomic_t val; + struct { +#ifdef __LITTLE_ENDIAN + u16 locked_pending; +

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Waiman Long
On 04/17/2014 11:51 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: @@ -48,6 +53,9 @@ * We can further change the first spinner to spin on a bit in the lock word * instead of its node; whereby avoiding the need to carry a node from lock to * unlock

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Waiman Long
On 04/17/2014 11:50 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: +#if !defined(__LITTLE_ENDIAN)&& !defined(__BIG_ENDIAN) +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition." +#endif This seems entirely superfluous, I don't think a kernel bu

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > +static __always_inline void > +clear_pending_set_locked(struct qspinlock *lock, u32 val) > +{ > + struct __qspinlock *l = (void *)lock; > + > + ACCESS_ONCE(l->locked_pending) = 1; > +} > @@ -157,8 +251,13 @@ static inline int

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > +struct __qspinlock { > + union { > + atomic_t val; > + struct { > +#ifdef __LITTLE_ENDIAN > + u16 locked_pending; > + u16 tail; > +#else > +

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > +#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN) > +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition." > +#endif This seems entirely superfluous, I don't think a kernel build will go anywhere if either is missing.

Re: [PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS

2014-04-17 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > @@ -48,6 +53,9 @@ > * We can further change the first spinner to spin on a bit in the lock word > * instead of its node; whereby avoiding the need to carry a node from lock > to > * unlock, and preserving API. > + * > + * N.B. Th