pgsql: Use the new shmem allocation functions in a few core subsystems - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Use the new shmem allocation functions in a few core subsystems
Date
Msg-id E1w9WsZ-0039A5-0W@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use the new shmem allocation functions in a few core subsystems

These subsystems have some complicating properties, making them
slightly harder to convert than most:

- The initialization callbacks of some of these subsystems have
  dependencies, i.e. they need to be initialized in the right order.

- The ProcGlobal pointer still needs to be inherited by the
  BackendParameters mechanism on EXEC_BACKEND builds, because
  ProcGlobal is required by InitProcess() to get a PGPROC entry, and
  the PGPROC entry is required to use LWLocks, and usually attaching
  to shared memory areas requires the use of LWLocks.

- Similarly, ProcSignal pointer still needs to be handled by
  BackendParameters, because query cancellation connections access it
  without calling InitProcess

Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/CAExHW5vM1bneLYfg0wGeAa=52UiJ3z4vKd3AJ72X8Fw6k3KKrg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/twophase.c  |   2 +-
src/backend/access/transam/varsup.c    |  35 +++---
src/backend/port/posix_sema.c          |  22 ++--
src/backend/port/sysv_sema.c           |  21 ++--
src/backend/port/win32_sema.c          |  11 +-
src/backend/storage/ipc/dsm.c          |  64 ++++++-----
src/backend/storage/ipc/dsm_registry.c |  36 ++++---
src/backend/storage/ipc/ipci.c         |  28 -----
src/backend/storage/ipc/latch.c        |   8 +-
src/backend/storage/ipc/pmsignal.c     |  51 +++++----
src/backend/storage/ipc/procarray.c    | 110 +++++++++----------
src/backend/storage/ipc/procsignal.c   |  64 ++++++-----
src/backend/storage/ipc/sinvaladt.c    |  38 +++----
src/backend/storage/lmgr/proc.c        | 191 +++++++++++++++++----------------
src/backend/utils/hash/dynahash.c      |   3 +-
src/include/access/transam.h           |   2 -
src/include/storage/dsm.h              |   3 -
src/include/storage/dsm_registry.h     |   2 -
src/include/storage/pg_sema.h          |   6 +-
src/include/storage/pmsignal.h         |   2 -
src/include/storage/proc.h             |   2 -
src/include/storage/procarray.h        |   2 -
src/include/storage/procsignal.h       |   3 -
src/include/storage/sinvaladt.h        |   2 -
src/include/storage/subsystemlist.h    |  17 ++-
25 files changed, 344 insertions(+), 381 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Introduce a registry of built-in shmem subsystems
Next
From: Michael Paquier
Date:
Subject: pgsql: Add tests for lock statistics, take two