[RFC PATCH] riscv/locking: Strengthen spin_lock() and spin_unlock()
Peter Zijlstra
peterz at infradead.org
Tue Mar 6 05:00:59 PST 2018
On Mon, Feb 26, 2018 at 09:00:43AM -0800, Linus Torvalds wrote:
> On Mon, Feb 26, 2018 at 8:24 AM, Will Deacon <will.deacon at arm.com> wrote:
> >
> > Strictly speaking, that's not what we've got implemented on arm64: only
> > the read part of the RmW has Acquire semantics, but there is a total
> > order on the lock/unlock operations for the lock.
>
> Hmm.
>
> I thought we had exactly that bug on some architecture with the queued
> spinlocks, and people decided it was wrong.
So ARM64 and Power have the acquire-on-load only thing, but qspinlock
has it per construction on anything that allowes reordering stores.
Given that unlock/lock are ordered, which covers about 99% of the users
out there, and fixing the issue would make things significantly slower
on the weak architectures we let it be.
But yes, its a pesky detail.
More information about the linux-riscv
mailing list