lkml.org 
[lkml]   [2009]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [this_cpu_xx V7 0/8] Per cpu atomics in core allocators and cleanup
On Thu, 17 Dec 2009, Mathieu Desnoyers wrote:

> Some quick test on my Intel Xeon E5405:
>
> local cmpxchg: 14 cycles
> xchg: 18 cycles
>
> So yes, indeed, the non-LOCK prefixed local cmpxchg seems a bit faster
> than the xchg, given the latter has an implied LOCK prefix.
>
> Code used for local cmpxchg:
> old = var;
> do {
> ret = cmpxchg_local(&var, old, 4);
> if (likely(ret == old))
> break;
> old = ret;
> } while (1);
>

Great. Could you also put that into "patch-format"?



\
 
 \ /
  Last update: 2009-12-17 21:47    [W:0.139 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site