From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use a separate spinlock to protect LWLockTranches
Date: Thu, 26 Mar 2026 22:03:58 +0000
Message-ID: <E1w5so1-001bOF-1A@gemulon.postgresql.org> (raw)
Use a separate spinlock to protect LWLockTranches
Previously we reused the shmem allocator's ShmemLock to also protect
lwlock.c's shared memory structures. Introduce a separate spinlock for
lwlock.c for the sake of modularity. Now that lwlock.c has its own
shared memory struct (LWLockTranches), this is easy to do.
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://www.postgresql.org/message-id/47aaf57e-1b7b-4e12-bda2-0316081ff50e@iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/12e3e0f2c8f7a47902b4c201ac31a12390f75657
Modified Files
--------------
src/backend/storage/ipc/shmem.c | 8 +++-----
src/backend/storage/lmgr/lwlock.c | 26 +++++++++++++-------------
src/include/storage/shmem.h | 1 -
3 files changed, 16 insertions(+), 19 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: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Use a separate spinlock to protect LWLockTranches
In-Reply-To: <E1w5so1-001bOF-1A@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