Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-20 Thread Will Deacon
On Fri, Sep 20, 2013 at 05:00:19PM +0100, Linus Torvalds wrote: > On Fri, Sep 20, 2013 at 10:45 AM, Will Deacon wrote: > > If we can guarantee that the CODE just messes around with the lockref, those > > barriers probably aren't needed... > > Yes. I've been thyinking about the barrier issue, and

Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-20 Thread Linus Torvalds
On Fri, Sep 20, 2013 at 10:45 AM, Will Deacon wrote: > > Right, turns out I can get some interesting numbers from your simple t.c > program on my dual-cluster, 5 CPU ARMv7 machine. The new cmpxchg-based lockref > code gives ~50% improvement, but the fun part is that implementing cmpxchg64 > withou

Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-20 Thread Will Deacon
On Fri, Sep 20, 2013 at 11:08:06AM +0100, Will Deacon wrote: > On Thu, Sep 19, 2013 at 07:11:32PM +0100, Linus Torvalds wrote: > > From a performance standpoint, lockref really is expected to mainly > > help with big machines. Only insane people would do big machines with > > 32-bit kernels these d

Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-20 Thread Will Deacon
On Thu, Sep 19, 2013 at 07:11:32PM +0100, Linus Torvalds wrote: > On Thu, Sep 19, 2013 at 1:06 PM, Will Deacon wrote: > > The cmpxchg() function tends not to support 64-bit arguments on 32-bit > > architectures. This could be either due to use of unsigned long arguments > > (like on ARM) or lack o

Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-19 Thread Waiman Long
On 09/19/2013 02:11 PM, Linus Torvalds wrote: On Thu, Sep 19, 2013 at 1:06 PM, Will Deacon wrote: The cmpxchg() function tends not to support 64-bit arguments on 32-bit architectures. This could be either due to use of unsigned long arguments (like on ARM) or lack of instruction support (cmpxch

[PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-19 Thread Will Deacon
The cmpxchg() function tends not to support 64-bit arguments on 32-bit architectures. This could be either due to use of unsigned long arguments (like on ARM) or lack of instruction support (cmpxchgq on x86). However, these architectures may implement a specific cmpxchg64() function to provide 64-b

Re: [PATCH] lockref: use cmpxchg64 explicitly for lockless updates

2013-09-19 Thread Linus Torvalds
On Thu, Sep 19, 2013 at 1:06 PM, Will Deacon wrote: > The cmpxchg() function tends not to support 64-bit arguments on 32-bit > architectures. This could be either due to use of unsigned long arguments > (like on ARM) or lack of instruction support (cmpxchgq on x86). However, > these architectures