pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.
Date: 2026-10-06 19:34:48
Message-ID: E1xEAw4-00000000agx-1iA1@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use a non-locking initial test in TAS_SPIN on AArch64.

Our testing showed that this is helpful at sufficiently high
contention levels and doesn't hurt performance on smaller machines.
The new TAS_SPIN macro for AArch64 is identical to the ones added
for PPC and x86_64 (see commits bc2a050d40 and b03d196be0).

Back-patch of commit 3d0b4b1068, which first shipped in v18.
Salvatore Dipietro reports that this change is beneficial on newer
Linux kernels, and the original commit has aged long enough to
provide some confidence that it won't cause problems. v14 is left
alone since it lacks commit a82a5eee31 and will soon be out of
support.

Reported-by: Salvatore Dipietro <dipiets(at)amazon(dot)it>
Reviewed-by: Jingtang Zhang <mrdrivingduck(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Tested-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/ZxgDEb_VpWyNZKB_%40nathan
Discussion: https://postgr.es/m/20260915114623.431827-1-dipiets%40amazon.it
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a8e7b27e32ded8fe7f8717647131568896bc7533

Modified Files
--------------
src/include/storage/s_lock.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2026-10-06 22:22:14 pgsql: Rescind unsafe deduplication support.
Previous Message Tom Lane 2026-10-06 19:08:07 pgsql: Doc: correct overambitious precision claim for contrib/seg.