Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, tender wang <tndrwang@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-02-06T15:25:10Z
Lists: pgsql-hackers
Attachments
- v18-enlarge-slru-buffers.patch (text/x-diff) patch v18
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 GUCs: commit_timestamp_slru_buffers transaction_slru_buffers etc -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Aprender sin pensar es inútil; pensar sin aprender, peligroso" (Confucio)
Commits
-
Fix zeroing of pg_serial page without SLRU bank lock
- be2f07310063 17.0 landed
-
Fix misspelled assertions
- 0d3a71d0c8a7 17.0 landed
-
GUC table: Add description to computed variables
- 30b8d6e4ce11 17.0 landed
-
Improve performance of subsystems on top of SLRU
- 53c2a97a9266 17.0 landed
-
Rename SLRU elements in view pg_stat_slru
- bcdfa5f2e2f2 17.0 landed
-
Use atomic access for SlruShared->latest_page_number
- d172b717c6f4 17.0 landed
-
Split use of SerialSLRULock, creating SerialControlLock
- 7b745d85b80d 17.0 landed
-
Index SLRUs by 64-bit integers rather than by 32-bit integers
- 4ed8f0913bfd 17.0 cited
-
Add a macro templatized hashtable.
- b30d3ea824c5 10.0 cited