pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Cc: dipiets@amazon.com
Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64
Date: Wed, 8 Jan 2025 16:01:19 -0600
Message-ID: <Z371r_AVOU0WCrBr@nathan> (raw)
In-Reply-To: <tdex7aj3zrvdu22dfgtljbrybrjezbjpr374otnadi6qxywkmc@rzxtb2fbubpy>
References: <ZxgDEb_VpWyNZKB_@nathan>
	<Z37AA6-SsJoLaifa@nathan>
	<tdex7aj3zrvdu22dfgtljbrybrjezbjpr374otnadi6qxywkmc@rzxtb2fbubpy>

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





view thread (22+ messages)  latest in thread

Message-ID: <Z371r_AVOU0WCrBr@nathan>
Permalink:  ../Z371r_AVOU0WCrBr@nathan/
Also on:    postgresql.org/message-id/Z371r_AVOU0WCrBr@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, andres@anarazel.de, dipiets@amazon.com
  Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64
  In-Reply-To: <Z371r_AVOU0WCrBr@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox