Re: [RFC PATCH 0/6 v2] Queued spinlocks/RW-locks for ARM

Waiman Long
2019-10-17T15:37:00Z

On 10/16/19 6:09 PM, Sebastian Andrzej Siewior wrote:
> On 2019-10-16 16:57:56 [+0100], Will Deacon wrote:
>> Hi Sebastian,
> Hi Will,
>
>> To be honest with you, I'm surprised that qspinlock is worth it for 32-bit
>> Arm. qrwlock makes sense because of fairness and starvation issues, but in
>> my benchmarks on arm64 tickets tended to perform at least as well for small
>> core counts, and I think that's largely going to be true for systems
>> running a 32-bit kernel.
> Waiman had numbers on x86 on how good this q-lock thingy is and x86
> moved to this. ARM64 didn't state a reason in particular only saying
> "it served us well but we do q-locks now" (this is how I remember it
> after I went over the git logs some time ago).
> Not knowing anything about qspin vs ticket locking I looked on how hard
> will be to switch. Then I looked with hackbench at it to see if it was
> worth it and it didn't look that bad. Plus the diffstat was negative so…

I had seen microbenchmarks like fio that on 2-socket arm64 systems (with
> 100 logical CPUs), you can get 4-5X performance out of qspinlock when
compared with ticket lock. It was more than I usually saw on x86-64
system. My conclusion is that arm64 systems are probably more
susceptible to the ill effect of cacheline contention than x86-64
systems. So it is certainly a win for arm64.

Cheers,
Longman