From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: bufmgr: Make UnlockReleaseBuffer() more efficient
Date: Fri, 27 Mar 2026 19:58:51 +0000
Message-ID: <E1w6DKV-001k14-0A@gemulon.postgresql.org> (raw)
bufmgr: Make UnlockReleaseBuffer() more efficient
Now that the buffer content lock is implemented as part of BufferDesc.state,
releasing the lock and unpinning the buffer can be implemented as a single
atomic operation.
This improves workloads that have heavy contention on a small number of
buffers substantially, I e.g., see a ~20% improvement for pipelined readonly
pgbench on an older two socket machine.
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f39cb8c011062d65e146c1e9d1aae221e96d8320
Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 58 +++++++++++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 3 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: bufmgr: Make UnlockReleaseBuffer() more efficient
In-Reply-To: <E1w6DKV-001k14-0A@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox