Re: spinlock support on loongarch64
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: 吴亚飞 <wuyf41619@hundsun.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2022-11-02T18:29:44Z
Lists: pgsql-hackers
Attachments
- fall-back-to-__sync_lock_test_and_set-1.patch (text/x-diff) patch
Andres Freund <andres@anarazel.de> writes: > On 2022-11-02 11:37:35 -0400, Tom Lane wrote: >> 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. So about like this, then. regards, tom lane
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