Use simplehash for backend-private buffer pin refcounts.

Peter Geoghegan <pg@bowt.ie>

Commit: a367c433ad015b889ee296b07de00017819915c4
Author: Peter Geoghegan <pg@bowt.ie>
Date: 2026-03-12T17:26:16Z
Use simplehash for backend-private buffer pin refcounts.

Replace dynahash with simplehash for the per-backend PrivateRefCountHash
overflow table.  Simplehash generates inlined, open-addressed lookup
code, avoiding the per-call overhead of dynahash that becomes noticeable
when many buffers are pinned with a CPU-bound workload.

Motivated by testing of the index prefetching patch, which pins many
more buffers concurrently than typical index scans.

Author: Peter Geoghegan <pg@bowt.ie>
Suggested-by: Andres Freund <andres@anarazel.de>
Reviewed-By: Tomas Vondra <tomas@vondra.me>
Reviewed-By: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAH2-Wz=g=JTSyDB4UtB5su2ZcvsS7VbP+ZMvvaG6ABoCb+s8Lw@mail.gmail.com

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +35 −33
src/tools/pgindent/typedefs.list modified +2 −0

Discussion