PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lwlocklist.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * lwlocklist.h
4 *
5 * The list of predefined LWLocks and built-in LWLock tranches is kept in
6 * its own source file for use by automatic tools. The exact
7 * representation of a keyword is determined by the PG_LWLOCK and
8 * PG_LWLOCKTRANCHE macros, which are not defined in this file; they can be
9 * defined by the caller for special purposes.
10 *
11 * Also, generate-lwlocknames.pl processes this file to create lwlocknames.h.
12 *
13 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
14 * Portions Copyright (c) 1994, Regents of the University of California
15 *
16 * IDENTIFICATION
17 * src/include/storage/lwlocklist.h
18 *
19 *-------------------------------------------------------------------------
20 */
21
22/*
23 * Some commonly-used locks have predefined positions within MainLWLockArray;
24 * these are defined here. If you add a lock, add it to the end to avoid
25 * renumbering the existing locks; if you remove a lock, consider leaving a gap
26 * in the numbering sequence for the benefit of DTrace and other external
27 * debugging scripts. Also, do not forget to update the section
28 * WaitEventLWLock of src/backend/utils/activity/wait_event_names.txt.
29 *
30 * Note that the names here don't include the Lock suffix, to appease the
31 * C preprocessor; it's added elsewhere.
32 */
33
34/* 0 is available; was formerly BufFreelistLock */
36PG_LWLOCK(2, OidGen)
37PG_LWLOCK(3, XidGen)
38PG_LWLOCK(4, ProcArray)
39PG_LWLOCK(5, SInvalRead)
40PG_LWLOCK(6, SInvalWrite)
41PG_LWLOCK(7, WALBufMapping)
42PG_LWLOCK(8, WALWrite)
44/* 10 was CheckpointLock */
45/* 11 was XactSLRULock */
46/* 12 was SubtransSLRULock */
47PG_LWLOCK(13, MultiXactGen)
48/* 14 was MultiXactOffsetSLRULock */
49/* 15 was MultiXactMemberSLRULock */
50PG_LWLOCK(16, RelCacheInit)
51PG_LWLOCK(17, CheckpointerComm)
53PG_LWLOCK(19, TablespaceCreate)
54PG_LWLOCK(20, BtreeVacuum)
55PG_LWLOCK(21, AddinShmemInit)
56PG_LWLOCK(22, Autovacuum)
57PG_LWLOCK(23, AutovacuumSchedule)
58PG_LWLOCK(24, SyncScan)
59PG_LWLOCK(25, RelationMapping)
60/* 26 was NotifySLRULock */
61PG_LWLOCK(27, NotifyQueue)
62PG_LWLOCK(28, SerializableXactHash)
63PG_LWLOCK(29, SerializableFinishedList)
64PG_LWLOCK(30, SerializablePredicateList)
65/* 31 was SerialSLRULock */
66PG_LWLOCK(32, SyncRep)
68PG_LWLOCK(34, DynamicSharedMemoryControl)
69PG_LWLOCK(35, AutoFile)
70PG_LWLOCK(36, ReplicationSlotAllocation)
71PG_LWLOCK(37, ReplicationSlotControl)
72/* 38 was CommitTsSLRULock */
73PG_LWLOCK(39, CommitTs)
74PG_LWLOCK(40, ReplicationOrigin)
75PG_LWLOCK(41, MultiXactTruncation)
76/* 42 was OldSnapshotTimeMapLock */
78PG_LWLOCK(44, XactTruncation)
79/* 45 was XactTruncationLock until removal of BackendRandomLock */
80PG_LWLOCK(46, WrapLimitsVacuum)
81PG_LWLOCK(47, NotifyQueueTail)
82PG_LWLOCK(48, WaitEventCustom)
83PG_LWLOCK(49, WALSummarizer)
84PG_LWLOCK(50, DSMRegistry)
85PG_LWLOCK(51, InjectionPoint)
87PG_LWLOCK(53, AioWorkerSubmissionQueue)
88PG_LWLOCK(54, WaitLSN)
89
90/*
91 * There also exist several built-in LWLock tranches. As with the predefined
92 * LWLocks, be sure to update the WaitEventLWLock section of
93 * src/backend/utils/activity/wait_event_names.txt when modifying this list.
94 *
95 * Note that the IDs here (the first value) don't include the LWTRANCHE_
96 * prefix. It's added elsewhere.
97 */
98PG_LWLOCKTRANCHE(XACT_BUFFER, XactBuffer)
99PG_LWLOCKTRANCHE(COMMITTS_BUFFER, CommitTsBuffer)
100PG_LWLOCKTRANCHE(SUBTRANS_BUFFER, SubtransBuffer)
101PG_LWLOCKTRANCHE(MULTIXACTOFFSET_BUFFER, MultiXactOffsetBuffer)
102PG_LWLOCKTRANCHE(MULTIXACTMEMBER_BUFFER, MultiXactMemberBuffer)
103PG_LWLOCKTRANCHE(NOTIFY_BUFFER, NotifyBuffer)
104PG_LWLOCKTRANCHE(SERIAL_BUFFER, SerialBuffer)
105PG_LWLOCKTRANCHE(WAL_INSERT, WALInsert)
106PG_LWLOCKTRANCHE(BUFFER_CONTENT, BufferContent)
107PG_LWLOCKTRANCHE(REPLICATION_ORIGIN_STATE, ReplicationOriginState)
108PG_LWLOCKTRANCHE(REPLICATION_SLOT_IO, ReplicationSlotIO)
109PG_LWLOCKTRANCHE(LOCK_FASTPATH, LockFastPath)
110PG_LWLOCKTRANCHE(BUFFER_MAPPING, BufferMapping)
111PG_LWLOCKTRANCHE(LOCK_MANAGER, LockManager)
112PG_LWLOCKTRANCHE(PREDICATE_LOCK_MANAGER, PredicateLockManager)
113PG_LWLOCKTRANCHE(PARALLEL_HASH_JOIN, ParallelHashJoin)
114PG_LWLOCKTRANCHE(PARALLEL_BTREE_SCAN, ParallelBtreeScan)
115PG_LWLOCKTRANCHE(PARALLEL_QUERY_DSA, ParallelQueryDSA)
116PG_LWLOCKTRANCHE(PER_SESSION_DSA, PerSessionDSA)
117PG_LWLOCKTRANCHE(PER_SESSION_RECORD_TYPE, PerSessionRecordType)
118PG_LWLOCKTRANCHE(PER_SESSION_RECORD_TYPMOD, PerSessionRecordTypmod)
119PG_LWLOCKTRANCHE(SHARED_TUPLESTORE, SharedTupleStore)
120PG_LWLOCKTRANCHE(SHARED_TIDBITMAP, SharedTidBitmap)
121PG_LWLOCKTRANCHE(PARALLEL_APPEND, ParallelAppend)
122PG_LWLOCKTRANCHE(PER_XACT_PREDICATE_LIST, PerXactPredicateList)
123PG_LWLOCKTRANCHE(PGSTATS_DSA, PgStatsDSA)
124PG_LWLOCKTRANCHE(PGSTATS_HASH, PgStatsHash)
125PG_LWLOCKTRANCHE(PGSTATS_DATA, PgStatsData)
126PG_LWLOCKTRANCHE(LAUNCHER_DSA, LogicalRepLauncherDSA)
127PG_LWLOCKTRANCHE(LAUNCHER_HASH, LogicalRepLauncherHash)
128PG_LWLOCKTRANCHE(DSM_REGISTRY_DSA, DSMRegistryDSA)
129PG_LWLOCKTRANCHE(DSM_REGISTRY_HASH, DSMRegistryHash)
130PG_LWLOCKTRANCHE(COMMITTS_SLRU, CommitTsSLRU)
131PG_LWLOCKTRANCHE(MULTIXACTOFFSET_SLRU, MultiXactOffsetSLRU)
132PG_LWLOCKTRANCHE(MULTIXACTMEMBER_SLRU, MultiXactMemberSLRU)
133PG_LWLOCKTRANCHE(NOTIFY_SLRU, NotifySLRU)
134PG_LWLOCKTRANCHE(SERIAL_SLRU, SerialSLRU)
135PG_LWLOCKTRANCHE(SUBTRANS_SLRU, SubtransSLRU)
136PG_LWLOCKTRANCHE(XACT_SLRU, XactSLRU)
137PG_LWLOCKTRANCHE(PARALLEL_VACUUM_DSA, ParallelVacuumDSA)
138PG_LWLOCKTRANCHE(AIO_URING_COMPLETION, AioUringCompletion)
#define PG_LWLOCK(id, lockname)
#define PG_LWLOCKTRANCHE(id, lockname)
static HTAB * ShmemIndex
Definition: shmem.c:92
static TwoPhaseStateData * TwoPhaseState
Definition: twophase.c:189
static ControlFileData * ControlFile
Definition: xlog.c:575