Re: Remove Instruction Synchronization Barrier in spin_delay() for ARM64 architecture - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Remove Instruction Synchronization Barrier in spin_delay() for ARM64 architecture
Date
Msg-id aJ91IK8h3x8B-9WA@nathan
Whole thread Raw
In response to Re: Remove Instruction Synchronization Barrier in spin_delay() for ARM64 architecture  (Andres Freund <andres@anarazel.de>)
Responses Re: Remove Instruction Synchronization Barrier in spin_delay() for ARM64 architecture
List pgsql-hackers
On Fri, Aug 15, 2025 at 01:39:52PM -0400, Andres Freund wrote:
> On 2025-08-14 11:29:08 +0200, Álvaro Herrera wrote:
>> However, changing that spinlock to an lwlock doesn't look easy, because of
>> the way each pgss entry is created as a dynahash entry, and then deallocated
>> from there.  With spinlocks we can just reinit the spinlock each time, but
>> that doesn't work with lwlocks.  We have no easy way to associate then
>> disassociate each entry from a specific lwlock.
> 
> I'm not following? The lwlock can just be inside the struct, just like the
> spinlock is? "Association" is just LWLockInitialize() and deassociation is not
> needed.

Indeed.  I rebased an old patch that I had lying around to demonstrate.  If
my past testing [0] is to be trusted, this actually hurts performance,
unfortunately.

[0] https://postgr.es/m/Zs4hJ6-Fg8DMgU_P@nathan

-- 
nathan

Attachment

pgsql-hackers by date:

Previous
From: Timur Magomedov
Date:
Subject: Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Next
From: "Burd, Greg"
Date:
Subject: Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected