pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use a non-locking initial test in TAS_SPIN on PPC.
6+ messages / 3 participants
[nested] [flat]

* pgsql: Use a non-locking initial test in TAS_SPIN on PPC.
@ 2012-01-03 21:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2012-01-03 21:00 UTC (permalink / raw)
  To: pgsql-committers

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

Further testing convinces me that this is helpful at sufficiently high
contention levels, though it's still worrisome that it loses slightly
at lower contention levels.

Per Manabu Ori.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bc2a050d40976441cdb963ad829316c23e8df0aa

Modified Files
--------------
src/include/storage/s_lock.h |    3 +++
1 files changed, 3 insertions(+), 0 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Use a non-locking initial test in TAS_SPIN on x86_64.
@ 2013-08-29 11:06  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2013-08-29 11:06 UTC (permalink / raw)
  To: pgsql-committers

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

Testing done in 2011 by Tom Lane concluded that this is a win on Intel Xeons
and AMD Opterons, but it was not changed back then, because of an old
comment in tas() that suggested that it's a huge loss on older Opterons.
However, didn't have separate TAS() and TAS_SPIN() macros back then, so the
comment referred to doing a non-locked initial test even on the first
access, in uncontended case. I don't have access to older Opterons, but I'm
pretty sure that doing an initial unlocked test is unlikely to be a loss
while spinning, even though it might be for the first access.

We probably should do the same on 32-bit x86, but I'm afraid of changing it
without any testing. Hence just add a note to the x86 implementation
suggesting that we probably should do the same there.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b03d196be055450c7260749f17347c2d066b4254

Modified Files
--------------
src/include/storage/s_lock.h |   22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.
@ 2025-01-10 19:18  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Nathan Bossart @ 2025-01-10 19:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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).

Reported-by: Salvatore Dipietro
Reviewed-by: Jingtang Zhang, Andres Freund
Tested-by: Tom Lane
Discussion: https://postgr.es/m/ZxgDEb_VpWyNZKB_%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3d0b4b1068018f624d5ef7c9f90b536ed58345b5

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.
@ 2026-10-06 19:34  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Nathan Bossart @ 2026-10-06 19:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@amazon.it>
Reviewed-by: Jingtang Zhang <mrdrivingduck@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Tested-by: Tom Lane <tgl@sss.pgh.pa.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_17_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.
@ 2026-10-06 19:34  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Nathan Bossart @ 2026-10-06 19:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@amazon.it>
Reviewed-by: Jingtang Zhang <mrdrivingduck@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Tested-by: Tom Lane <tgl@sss.pgh.pa.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_16_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Use a non-locking initial test in TAS_SPIN on AArch64.
@ 2026-10-06 19:34  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Nathan Bossart @ 2026-10-06 19:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@amazon.it>
Reviewed-by: Jingtang Zhang <mrdrivingduck@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Tested-by: Tom Lane <tgl@sss.pgh.pa.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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-10-06 19:34 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 21:00 pgsql: Use a non-locking initial test in TAS_SPIN on PPC. Tom Lane <tgl@sss.pgh.pa.us>
2013-08-29 11:06 pgsql: Use a non-locking initial test in TAS_SPIN on x86_64. Heikki Linnakangas <heikki.linnakangas@iki.fi>
2025-01-10 19:18 pgsql: Use a non-locking initial test in TAS_SPIN on AArch64. Nathan Bossart <nathan@postgresql.org>
2026-10-06 19:34 pgsql: Use a non-locking initial test in TAS_SPIN on AArch64. Nathan Bossart <nathan@postgresql.org>
2026-10-06 19:34 pgsql: Use a non-locking initial test in TAS_SPIN on AArch64. Nathan Bossart <nathan@postgresql.org>
2026-10-06 19:34 pgsql: Use a non-locking initial test in TAS_SPIN on AArch64. Nathan Bossart <nathan@postgresql.org>

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