Re: BufferAlloc: don't take two simultaneous locks - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: BufferAlloc: don't take two simultaneous locks
Date
Msg-id 294BEBA2-92D9-4932-A449-AE471EF9FF97@yandex-team.ru
Whole thread Raw
In response to BufferAlloc: don't take two simultaneous locks  (Yura Sokolov <y.sokolov@postgrespro.ru>)
Responses Re: BufferAlloc: don't take two simultaneous locks
List pgsql-hackers

> 21 дек. 2021 г., в 10:23, Yura Sokolov <y.sokolov@postgrespro.ru> написал(а):
>
> <v1-0001-bufmgr-do-not-acquire-two-partition-lo.patch>

Hi Yura!

I've took a look into the patch. The idea seems reasonable to me: clearing\evicting old buffer and placing new one seem
tobe different units of work, there is no need to couple both partition locks together. And the claimed performance
impactis fascinating! Though I didn't verify it yet. 

On a first glance API change in BufTable does not seem obvious to me. Is void *oldelem actually BufferTag * or maybe
BufferLookupEnt*? What if we would like to use or manipulate with oldelem in future? 

And the name BufTableFreeDeleted() confuses me a bit. You know, in C we usually free(), but in C++ we delete [], and
herewe do both... Just to be sure. 

Thanks!

Best regards, Andrey Borodin.




pgsql-hackers by date:

Previous
From: Shruthi Gowda
Date:
Subject: Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce)
Next
From: Julien Rouhaud
Date:
Subject: Re: Proposal: allow database-specific role memberships