pgsql: Refactor shared memory allocation for semaphores - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Refactor shared memory allocation for semaphores
Date
Msg-id E1vGzNS-005IKr-0c@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Refactor shared memory allocation for semaphores

Before commit e25626677f, spinlocks were implemented using semaphores
on some platforms (--disable-spinlocks). That made it necessary to
initialize semaphores early, before any spinlocks could be used. Now
that we don't support --disable-spinlocks anymore, we can allocate the
shared memory needed for semaphores the same way as other shared
memory structures. Since the semaphores are used only in the PGPROC
array, move the semaphore shmem size estimation and initialization
calls to ProcGlobalShmemSize() and InitProcGlobal().

Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAExHW5seSZpPx-znjidVZNzdagGHOk06F+Ds88MpPUbxd1kTaA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/aa9c5fd3e3d7f1e6154474e39ab71377136d463a

Modified Files
--------------
src/backend/port/posix_sema.c   |  6 +-----
src/backend/port/sysv_sema.c    |  6 +-----
src/backend/storage/ipc/ipci.c  | 31 +++++--------------------------
src/backend/storage/ipc/shmem.c |  3 ++-
src/backend/storage/lmgr/proc.c |  4 ++++
src/include/storage/ipc.h       |  2 +-
src/include/storage/shmem.h     |  1 -
7 files changed, 14 insertions(+), 39 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Fix redundancy in error message
Next
From: Álvaro Herrera
Date:
Subject: Re: pgsql: pg_createsubscriber: Fix error complaining about the wrong thing