Re: [PATCH v7 1/4] spinlock: A new lockref structure for locklessupdate of refcount

From: Sedat Dilek
Date: Fri Aug 30 2013 - 11:38:55 EST


On Fri, Aug 30, 2013 at 5:34 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Aug 30, 2013 at 2:27 AM, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>>
>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>
>> lockref: w/o patch | w/ patch
>> ======================
>> Run #1: 2.688.094 | 2.643.004
>> Run #2: 2.678.884 | 2.652.787
>> Run #3: 2.686.450 | 2.650.142
>> Run #4: 2.688.435 | 2.648.409
>> Run #5: 2.693.770 | 2.651.514
>
> Yes, so this is pretty much expected.
>
> If you don't have a very high core count (you don't mention your
> system, but that's pretty - I get ~65 million repetitions in 10
> seconds on my i5-670), the cmpxchg will not help - because you don't
> actually see the bad "wait on spinlock" behavior in the first place.
>
> And a "cmpxchg" is slightly slower than the very optimized spinlocks,
> and has that annoying "read original value" first issue too. So the
> patch can make things a bit slower, although it will depends on the
> microarchitecture (and as mentioned elsewhere, there are other things
> that can make a bigger difference boot-to-boot - dentry allocation
> details etc can have "sticky" performance impact).
>
> So we may take a small hit in order to then *not* have horrible
> scalability at the high end.
>

A Samsung series-5 ultrabook.

$ grep "model name" /proc/cpuinfo | uniq
model name : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz

- Sedat -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/