Re: Double partition lock in bufmgr - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Double partition lock in bufmgr
Date
Msg-id CAD21AoAdB5oU2oTqz8UMpzrAhsf=+wE_YwT5FxjwJDs_dZCyKQ@mail.gmail.com
Whole thread Raw
In response to Re: Double partition lock in bufmgr  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Hi Konstantin,

On Sat, Dec 19, 2020 at 9:50 PM Konstantin Knizhnik
<k.knizhnik@postgrespro.ru> wrote:
>
>
>
> 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
>

You sent in your patch, bufmgr.patch to pgsql-hackers on Dec 19, but
you did not post it to the next CommitFest[1].  If this was
intentional, then you need to take no action.  However, if you want
your patch to be reviewed as part of the upcoming CommitFest, then you
need to add it yourself before 2021-01-01 AoE[2]. Thanks for your
contributions.

Regards,

[1] https://commitfest.postgresql.org/31/
[2] https://en.wikipedia.org/wiki/Anywhere_on_Earth


-- 
Masahiko Sawada
EnterpriseDB:  https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: doc review for v14
Next
From: Masahiko Sawada
Date:
Subject: Re: row filtering for logical replication