Re: spinlock support on loongarch64
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 吴亚飞 <wuyf41619@hundsun.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2022-11-02T21:04:52Z
Lists: 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
Commits
-
Allow use of __sync_lock_test_and_set for spinlocks on any machine.
- 1c72d82c2584 16.0 landed
- c479492c04ee 13.9 landed
- a5737e765d85 15.1 landed
- a0f9be1f9266 11.18 landed
- 5ecf836e9b5e 12.13 landed
- 19cefebe71ea 10.23 landed
- 058c7b5dd4cc 14.6 landed