Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, tender wang <tndrwang(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Date: 2024-02-06 15:25:10
Message-ID: 202402061525.nq7yftgcs22v@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Here's the rest of it rebased on top of current master. I think it
makes sense to have this as one individual commit.

I made CLOGShmemBuffers, CommitTsShmemBuffers and SUBTRANSShmemBuffers
compute a number that's multiple of SLRU_BANK_SIZE. But it's a crock,
because we don't have that macro at that point, so I just used constant
16. Obviously need a better solution for this.

I also changed the location of bank_mask in SlruCtlData for better
packing, as advised by pahole; and renamed SLRU_SLOTNO_GET_BANKLOCKNO()
to SlotGetBankNumber().

Some very critical comments still need to be updated to the new design,
particularly anything that mentions "control lock"; but also the overall
model needs to be explained in some central location, rather than
incongruently some pieces here and other pieces there. I'll see about
this later. But at least this is code you should be able to play with.

I've been wondering whether we should add a "slru" to the name of the


Álvaro Herrera Breisgau, Deutschland —
"Aprender sin pensar es inútil; pensar sin aprender, peligroso" (Confucio)

Attachment Content-Type Size
v18-enlarge-slru-buffers.patch text/x-diff 108.6 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2024-02-06 15:27:36 Re: pg_stat_advisor extension
Previous Message Jelte Fennema-Nio 2024-02-06 15:22:28 Re: Possibility to disable `ALTER SYSTEM`