From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: bufmgr: Use atomic sub for unpinning buffers
Date: Thu, 06 Nov 2025 21:43:49 +0000
Message-ID: <E1vH7ll-005LsT-1n@gemulon.postgresql.org> (raw)
bufmgr: Use atomic sub for unpinning buffers
The prior commit made it legal to modify BufferDesc.state while the buffer
header spinlock is held. This allows us to replace the CAS loop
inUnpinBufferNoOwner() with an atomic sub. This improves scalability
significantly. See the prior commits for more background.
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5310fac6e0fcb1c7fcefb3446767673f9107328c
Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 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: Use atomic sub for unpinning buffers
In-Reply-To: <E1vH7ll-005LsT-1n@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