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