pgsql: bufmgr: Use atomic sub for unpinning buffers

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: bufmgr: Use atomic sub for unpinning buffers
Date: 2025-11-06 21:43:49
Message-ID: E1vH7ll-005LsT-1n@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2025-11-07 05:44:44 pgsql: doc: Clarify units for io_combine_limit and io_max_combine_limit
Previous Message David Rowley 2025-11-06 20:50:20 pgsql: Tidyup WARNING ereports in subscriptioncmds.c