Re: use a non-locking initial test in TAS_SPIN on AArch64

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, dipiets(at)amazon(dot)com
Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64
Date: 2025-01-08 22:01:19
Message-ID: Z371r_AVOU0WCrBr@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-01-08 22:25:24 Re: use a non-locking initial test in TAS_SPIN on AArch64
Previous Message Euler Taveira 2025-01-08 21:55:45 Re: [Patch] add new parameter to pg_replication_origin_session_setup