Re: Double partition lock in bufmgr

Поиск
Список
Период
Сортировка
От Konstantin Knizhnik
Тема Re: Double partition lock in bufmgr
Дата
Msg-id 335c3a13-74d1-26c0-584c-73ceed3a9ffc@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Double partition lock in bufmgr  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: Double partition lock in bufmgr  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-hackers

On 19.12.2020 10:53, Zhihong Yu wrote:
> Hi,
> w.r.t. the code in BufferAlloc(), the pointers are compared.
>
> Should we instead compare the tranche Id of the two LWLock ?
>
> Cheers

As far as LWlocks are stored in the array, comparing indexes in this 
array (tranche Id) is equivalent to comparing element's pointers.
So I do not see any problem here.

Just as experiment I tried a version of BufferAlloc without double 
locking (patch is attached).
I am not absolutely sure that my patch is correct: my main intention was 
to estimate influence of this buffer reassignment on performance.
I just run standard pgbench for database with scale 100 and default 
shared buffers size (256Mb). So there are should be a lot of page 
replacements.
I do not see any noticeable difference:

vanilla: 13087.596845
patch:   13184.442130


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alastair Turner
Дата:
Сообщение: Re: Proposed patch for key managment
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: multi-install PostgresNode