pgsql: Convert SharedFileSet->refcnt to an atomic variable. - Mailing list pgsql-committers

From Nathan Bossart
Subject pgsql: Convert SharedFileSet->refcnt to an atomic variable.
Date
Msg-id E1x965U-00000000oQm-3Z3Q@gemulon.postgresql.org
Whole thread
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Convert Sharedsort's worker counters to atomic variables.
Next
From: noreply@postgresql.org
Date:
Subject: pgsql: Tag refs/tags/REL_19_BETA4 was created