Re: SpinLockAcquire and SpinLockRelease is broken on ARM/ARM64? (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-06-03T21:04:55Z
Lists: pgsql-hackers
Hi,

On 2025-06-02 21:20:33 +0300, Yura Sokolov wrote:
> But still problem of spin lock contention is here.

I still would like to see a reproducer for this.


> So I propose to introduce another spin lock type capable for Exclusive and
> Shared lock modes (i.e. Write/Read modes) and use it in this two places.

I am vehemently opposed to that. We should work towards getting rid of
spinlocks, not introduce more versions of spinlocks. Userspace spinlocks
largely are a bad idea. We should instead make properly queued locks cheaper
(e.g. by having an exclusive-only lock, which can be cheaper to release on
common platforms).

Greetings,

Andres Freund



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Use replay LSN as target for cascading logical WAL senders

  2. doc PG 18 relnotes: adjust COPY and REJECT_LIMIT items