Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Will Deacon
gt; > involved. > > NP. Here's the current version I've got, with some updated likely() > hints. > > From 337298a88266f7b21492f893c2bf05409a5392c8 Mon Sep 17 00:00:00 2001 > From: Matthew Wilcox > Date: Mon, 20 Aug 2018 10:19:14 -0400 > Subject: [PATCH] lock

Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Matthew Wilcox
e updated likely() hints. >From 337298a88266f7b21492f893c2bf05409a5392c8 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Mon, 20 Aug 2018 10:19:14 -0400 Subject: [PATCH] locking: Remove an insn from spin and write locks Both spin locks and write locks currently do: f0 0f b1 17 l

Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Peter Zijlstra
On Mon, Aug 20, 2018 at 08:50:02AM -0700, Matthew Wilcox wrote: > On Mon, Aug 20, 2018 at 11:14:04AM -0400, Waiman Long wrote: > > On 08/20/2018 11:06 AM, Matthew Wilcox wrote: > > > Both spin locks and write locks currently do: > > > > > > f0 0f b1 17 lock cmpxchg %edx,(%rdi) > > > 8

Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Waiman Long
On 08/20/2018 11:50 AM, Matthew Wilcox wrote: > On Mon, Aug 20, 2018 at 11:14:04AM -0400, Waiman Long wrote: >> On 08/20/2018 11:06 AM, Matthew Wilcox wrote: >>> Both spin locks and write locks currently do: >>> >>> f0 0f b1 17 lock cmpxchg %edx,(%rdi) >>> 85 c0 test

Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Matthew Wilcox
On Mon, Aug 20, 2018 at 11:14:04AM -0400, Waiman Long wrote: > On 08/20/2018 11:06 AM, Matthew Wilcox wrote: > > Both spin locks and write locks currently do: > > > > f0 0f b1 17 lock cmpxchg %edx,(%rdi) > > 85 c0 test %eax,%eax > > 75 05 jne

Re: [PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Waiman Long
On 08/20/2018 11:06 AM, Matthew Wilcox wrote: > Both spin locks and write locks currently do: > > f0 0f b1 17 lock cmpxchg %edx,(%rdi) > 85 c0 test %eax,%eax > 75 05 jne[slowpath] > > This 'test' insn is superfluous; the cmpxchg insn sets the

[PATCH] locking: Remove an insn from spin and write locks

2018-08-20 Thread Matthew Wilcox
Both spin locks and write locks currently do: f0 0f b1 17 lock cmpxchg %edx,(%rdi) 85 c0 test %eax,%eax 75 05 jne[slowpath] This 'test' insn is superfluous; the cmpxchg insn sets the Z flag appropriately. Peter pointed out that using atomi