Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-06 Thread Peter Zijlstra
On Thu, Jun 05, 2014 at 11:08:23AM -0700, Davidlohr Bueso wrote: > I knew I had formally read this technique somewhere: > http://pdos.csail.mit.edu/6.828/2010/readings/mcs.pdf (part 2.1). > > Peter, what do you think of adding a new cmp_cmpxchg() or dcmpxchg() > call for such scenarios? Don't lik

Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-05 Thread Pranith Kumar
On Thu, Jun 5, 2014 at 3:22 AM, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 04:56:50PM -0400, Andev wrote: >> On Wed, Jun 4, 2014 at 4:38 PM, Pranith Kumar wrote: >> > remove a redundant comparision >> > >> > Signed-off-by: Pranith Kumar >> > --- >> > kernel/locking/rwsem-xadd.c | 3 +-- >>

Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-05 Thread Davidlohr Bueso
On Thu, 2014-06-05 at 10:54 -0700, Davidlohr Bueso wrote: > On Thu, 2014-06-05 at 09:22 +0200, Peter Zijlstra wrote: > > On Wed, Jun 04, 2014 at 04:56:50PM -0400, Andev wrote: > > > On Wed, Jun 4, 2014 at 4:38 PM, Pranith Kumar wrote: > > > > remove a redundant comparision > > > > > > > > Signed-o

Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-05 Thread Davidlohr Bueso
On Thu, 2014-06-05 at 09:22 +0200, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 04:56:50PM -0400, Andev wrote: > > On Wed, Jun 4, 2014 at 4:38 PM, Pranith Kumar wrote: > > > remove a redundant comparision > > > > > > Signed-off-by: Pranith Kumar > > > --- > > > kernel/locking/rwsem-xadd.c | 3

Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-05 Thread Peter Zijlstra
On Wed, Jun 04, 2014 at 04:56:50PM -0400, Andev wrote: > On Wed, Jun 4, 2014 at 4:38 PM, Pranith Kumar wrote: > > remove a redundant comparision > > > > Signed-off-by: Pranith Kumar > > --- > > kernel/locking/rwsem-xadd.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff -

Re: [RFC PATCH 1/1] remove redundant compare, cmpxchg already does it

2014-06-04 Thread Andev
On Wed, Jun 4, 2014 at 4:38 PM, Pranith Kumar wrote: > remove a redundant comparision > > Signed-off-by: Pranith Kumar > --- > kernel/locking/rwsem-xadd.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c > index