Re: [PATCH V8 07/22] LoongArch: Add atomic/locking headers

From: Arnd Bergmann
Date: Tue Mar 22 2022 - 05:24:18 EST


On Tue, Mar 22, 2022 at 4:03 AM Huacai Chen <chenhuacai@xxxxxxxxxx> wrote:
> On Mon, Mar 21, 2022 at 5:42 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> > On Sat, Mar 19, 2022 at 3:31 PM Huacai Chen <chenhuacai@xxxxxxxxxx> wrote:

> > Please coordinate the inclusion of the patches with them and use that
> > spinlock implementation for the initial merge, to avoid further discussion
> > on the topic. If at a later point you are able to come up with a qspinlock
> > implementation that has convincing forward-progress guarantees and
> > can be shown to be better, we can revisit this.
>
> In my opinion, forward-progress is solved in V2, since we have
> reworked __xchg_small()/__cmpxchg_small(), and qspinlock is needed by
> NUMA.
> However, if the generic ticket lock is merged later, I will try to use
> it at present.

Yes, please do. If I merge both the ticket spinlock code and your architecture
code through the asm-generic tree for 5.19, this should work out nicely.

I'd good to hear that you have a solution for the forward-progress
issue with qspinlock, We should discuss that when the architecture
is merged then, and see what this means for the other architectures
that currently use the qspinlock code, to decide which ones of those
should be converted to ticket lock, which can use the same approach
that you have, and which are already safe.

Arnd