Re: MultiXact\SLRU buffers configuration
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Gilles Darold <gilles@darold.net>,
Tomas Vondra <tomas.vondra@enterprisedb.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>,
Alexander Korotkov <aekorotkov@gmail.com>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>,
Daniel Gustafsson <daniel@yesql.se>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-26T20:26:40Z
Lists: pgsql-hackers
Attachments
- v13-0001-Make-all-SLRU-buffer-sizes-configurable.patch (application/x-patch) patch v13-0001
- v13-0002-Make-simplehash-easy-to-use-in-shmem.patch (application/x-patch) patch v13-0002
- v13-0003-Support-intrusive-status-flag-in-simplehash.patch (application/x-patch) patch v13-0003
- v13-0004-Add-buffer-mapping-table-for-SLRUs.patch (application/x-patch) patch v13-0004
- v13-0005-fixup-use-simplehash-instead-of-dynahash.patch (application/x-patch) patch v13-0005
On Sat, Mar 27, 2021 at 4:52 AM Andrey Borodin <x4mmm@yandex-team.ru> wrote: > Some thoughts on HashTable patch: > 1. Can we allocate bigger hashtable to reduce probability of collisions? Yeah, good idea, might require some study. > 2. Can we use specialised hashtable for this case? I'm afraid hash_search() does comparable number of CPU cycles as simple cycle from 0 to 128. We could inline everything and avoid hashp->hash(keyPtr, hashp->keysize) call. I'm not insisting on special hash though, just an idea. I tried really hard to not fall into this rabbit h.... [hack hack hack], OK, here's a first attempt to use simplehash, Andres's steampunk macro-based robinhood template that we're already using for several other things, and murmurhash which is inlineable and branch-free. I had to tweak it to support "in-place" creation and fixed size (in other words, no allocators, for use in shared memory). Then I was annoyed that I had to add a "status" member to our struct, so I tried to fix that. Definitely needs more work to think about failure modes when running out of memory, how much spare space you need, etc. I have not experimented with this much beyond hacking until the tests pass, but it *should* be more efficient... > 3. pageno in SlruMappingTableEntry seems to be unused. It's the key (dynahash uses the first N bytes of your struct as the key, but in this new simplehash version it's more explicit).
Commits
-
Rework new SLRU test with injection points
- 94a3373ac5c3 18.0 landed
-
injection_point: Add injection_points.stats
- 2e35c67f9568 18.0 landed
-
injection_points: Add initialization of shmem state when loading module
- b2b023aa3706 18.0 landed
-
Add injection-point test for new multixact CV usage
- 768a9fd5535f 18.0 landed
-
Use conditional variable to wait for next MultiXact offset
- a0e0fb1ba56f 17.0 landed
-
Improve performance of subsystems on top of SLRU
- 53c2a97a9266 17.0 landed
-
Adjust VACUUM hastup LP_REDIRECT comments.
- 325bc54eed4e 16.0 cited
-
Test replay of regression tests, attempt II.
- f47ed79cc8a0 15.0 cited