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

From Andres Freund
Subject Re: spinlock support on loongarch64
Date
Msg-id 20221102210452.ydontvnukjrkewp6@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 14:55:04 -0400, Tom Lane wrote:
> I wrote:
> > So about like this, then.
> 
> After actually testing (by removing the ARM stanza on a macOS machine),
> it seems that placement doesn't work, because of the default definition
> of S_UNLOCK at the bottom of the "#if defined(__GNUC__)" stuff.  Putting
> it inside that test works, and seems like it should be fine, since this
> is a GCC-ism.

Looks reasonable. I tested it on x86-64 by disabling that section and it
works.

FWIW, In a heavily spinlock-contending workload it's a tad slower, largely due
to to loosing spin_delay. If I define that it's very close. Not that it
matters hugely, I just thought it'd be good to validate.

I wonder if it's worth keeing the full copy of this in the arm section? We
could just define SPIN_DELAY() for aarch64?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: create subscription - improved warning message
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_dump: Refactor code that constructs ALTER ... OWNER TO commands