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

Sebastian Andrzej Siewior
2019-10-16T22:09:48Z

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've uploaded my (crude, was never meant to be shared!) benchmark harness
> here:
>
> https://mirrors.edge.kernel.org/pub/linux/kernel/people/will/spinbench
>
> which I used to generate graphs like:
>
> https://mirrors.edge.kernel.org/pub/linux/kernel/people/will/slides/arm64-spinlocks.pdf
>
> Maybe you could port it to 32-bit and see what the numbers look like? The
> qspinlock code probably needs re-syncing with mainline too, but see how you
> go. If it ends up being useful maybe I'll host it in a git tree.

Okay. Let me see what I can do.

> Will

Sebastian