Re: spinlock support on loongarch64 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: spinlock support on loongarch64
Date
Msg-id 20221102172706.e7aqmsh2phbsur3p@awork3.anarazel.de
Whole thread Raw
In response to Re: spinlock support on loongarch64  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: spinlock support on loongarch64
List pgsql-hackers
Hi,

On 2022-11-02 11:37:35 -0400, Tom Lane wrote:
> =?gb2312?B?zuLRx7fJ?= <wuyf41619@hundsun.com> writes:
> > add spinlock support on loongarch64.
> 
> I wonder if we shouldn't just do that (ie, try to use
> __sync_lock_test_and_set) as a generic fallback on any unsupported
> architecture.  We could get rid of the separate stanza for RISC-V
> that way.  The main thing that an arch-specific stanza could bring
> is knowledge of the best data type width to use for a spinlock;
> but I don't see a big problem with defaulting to "int".  We can
> always add arch-specific stanzas for any machines where that's
> shown to be a seriously poor choice.

Yes, please. It might not be perfect for all architectures, and it might not
be good for some very old architectures. But for anything new it'll be vastly
better than not having spinlocks at all.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Prefetch the next tuple's memory during seqscans
Next
From: "David G. Johnston"
Date:
Subject: Re: Glossary and initdb definition work for "superuser" and database/cluster