Re: [PATCH] riscv: locks: introduce ticket-based spinlock implementation

From: Peter Zijlstra
Date: Wed Mar 24 2021 - 08:24:45 EST


On Wed, Mar 24, 2021 at 12:15:47PM +0100, Vitaly Wool wrote:
> On Wed, Mar 24, 2021, 11:16 AM <guoren@xxxxxxxxxx> wrote:
>
> > From: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
> >
> > This patch introduces a ticket lock implementation for riscv, along the
> > same lines as the implementation for arch/arm & arch/csky.
> >
>
> Could you please provide a rationale for this? Like, what is wrong with the
> current implementation.

test-and-set spinlocks have terrible worst case behaviour.