Re: use a non-locking initial test in TAS_SPIN on AArch64 - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: use a non-locking initial test in TAS_SPIN on AArch64
Date
Msg-id Z371r_AVOU0WCrBr@nathan
Whole thread Raw
In response to Re: use a non-locking initial test in TAS_SPIN on AArch64  (Andres Freund <andres@anarazel.de>)
Responses Re: use a non-locking initial test in TAS_SPIN on AArch64
Re: use a non-locking initial test in TAS_SPIN on AArch64
List pgsql-hackers
On Wed, Jan 08, 2025 at 03:07:24PM -0500, Andres Freund wrote:
> Out of curiosity, have you measured whether this has a positive effect without
> pg_stat_statements? I think it'll e.g. also affect lwlocks, as they also use
> perform_spin_delay().

AFAICT TAS_SPIN() is only used for s_lock(), which doesn't appear to be
used by LWLocks.  But I did retry my test from upthread without
pg_stat_statements and was surprised to find a reproducible 4-6%
regression.  I'm not seeing any obvious differences in perf, but I do see
that the thread for adding TAS_SPIN() for PPC mentions a regression at
lower contention levels [0].  Perhaps the non-locked test is failing often
enough to hurt performance in this case...  Whatever it is, it'll be mighty
frustrating to miss out on a >7x gain because of a 4% regression.

[0] https://postgr.es/me/26496.1325625436%40sss.pgh.pa.us

-- 
nathan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: EphemeralNamedRelation and materialized view
Next
From: Andres Freund
Date:
Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64