agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Convert SharedFileSet->refcnt to an atomic variable.
Date: Tue, 22 Sep 2026 19:23:32 +0000
Message-ID: <E1x965U-00000000oQm-3Z3Q@gemulon.postgresql.org> (raw)
Convert SharedFileSet->refcnt to an atomic variable.
Currently, this variable is an int protected by a spinlock. By
converting it to an atomic variable, we can remove the spinlock.
Detaching becomes an atomic subtract, and attaching becomes a
compare-and-exchange loop, since it must not resurrect a fileset
whose reference count has already reached zero.
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Tested-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/alAJeRRzehDjLaF1%40nathan
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/09a579abaca86bcd85ebc49b247d2ec58bdc6d3b
Modified Files
--------------
src/backend/storage/file/sharedfileset.c | 33 ++++++++++++++------------------
src/include/storage/sharedfileset.h | 5 ++---
2 files changed, 16 insertions(+), 22 deletions(-)
Message-ID: <E1x965U-00000000oQm-3Z3Q@gemulon.postgresql.org>
Permalink: ../E1x965U-00000000oQm-3Z3Q@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1x965U-00000000oQm-3Z3Q@gemulon.postgresql.org
reply
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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Convert SharedFileSet->refcnt to an atomic variable.
In-Reply-To: <E1x965U-00000000oQm-3Z3Q@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox