Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-24 Thread Peter Zijlstra
On Fri, Jun 24, 2016 at 09:34:30AM -0700, Davidlohr Bueso wrote: > On Thu, 23 Jun 2016, Peter Zijlstra wrote: > > >- > >/* atomic_fetch_inc_relaxed */ > >#ifndef atomic_fetch_inc_relaxed > >+ > >+#ifndef atomic_fetch_inc > > #define atomic_fetch_inc(v) (atomic_fetch_add(1, v)) Ah yes. >

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-24 Thread Peter Zijlstra
On Fri, Jun 24, 2016 at 09:34:30AM -0700, Davidlohr Bueso wrote: > On Thu, 23 Jun 2016, Peter Zijlstra wrote: > > >- > >/* atomic_fetch_inc_relaxed */ > >#ifndef atomic_fetch_inc_relaxed > >+ > >+#ifndef atomic_fetch_inc > > #define atomic_fetch_inc(v) (atomic_fetch_add(1, v)) Ah yes. >

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-24 Thread Davidlohr Bueso
On Thu, 23 Jun 2016, Peter Zijlstra wrote: Would something like so make sense? --- --- a/include/linux/atomic.h +++ b/include/linux/atomic.h @@ -188,15 +188,18 @@ #endif #endif /* atomic_fetch_add_relaxed */ -#ifndef atomic_fetch_inc -#define atomic_fetch_inc(v) (atomic_fetch_add(1, v))

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-24 Thread Davidlohr Bueso
On Thu, 23 Jun 2016, Peter Zijlstra wrote: Would something like so make sense? --- --- a/include/linux/atomic.h +++ b/include/linux/atomic.h @@ -188,15 +188,18 @@ #endif #endif /* atomic_fetch_add_relaxed */ -#ifndef atomic_fetch_inc -#define atomic_fetch_inc(v) (atomic_fetch_add(1, v))

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-23 Thread Peter Zijlstra
On Tue, Jun 21, 2016 at 09:36:11AM -0700, Davidlohr Bueso wrote: > Sorry, I was also missing the _long variants. While at it I added a missing > ATOMIC_LONG_FETCH_INC_DEC_OP undef. > > --8<- > From: Davidlohr Bueso > Subject: [PATCH -v3

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-23 Thread Peter Zijlstra
On Tue, Jun 21, 2016 at 09:36:11AM -0700, Davidlohr Bueso wrote: > Sorry, I was also missing the _long variants. While at it I added a missing > ATOMIC_LONG_FETCH_INC_DEC_OP undef. > > --8<- > From: Davidlohr Bueso > Subject: [PATCH -v3 01/12]

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-21 Thread Davidlohr Bueso
Sorry, I was also missing the _long variants. While at it I added a missing ATOMIC_LONG_FETCH_INC_DEC_OP undef. --8<- From: Davidlohr Bueso Subject: [PATCH -v3 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors With

Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-21 Thread Davidlohr Bueso
Sorry, I was also missing the _long variants. While at it I added a missing ATOMIC_LONG_FETCH_INC_DEC_OP undef. --8<- From: Davidlohr Bueso Subject: [PATCH -v3 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors With the inclusion of

[PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-21 Thread Davidlohr Bueso
With the inclusion of atomic FETCH-OP variants, many places in the kernel can make use of atomic_fetch_$op() to avoid the hacky callers that need to compute the value/state _before_ the operation. Peter laid out the machinery but we are still missing the simpler dec,inc calls (which future

[PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors

2016-06-21 Thread Davidlohr Bueso
With the inclusion of atomic FETCH-OP variants, many places in the kernel can make use of atomic_fetch_$op() to avoid the hacky callers that need to compute the value/state _before_ the operation. Peter laid out the machinery but we are still missing the simpler dec,inc calls (which future