agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH v1 4/4] combine relopts correctly for VACUUM commands 197+ messages / 4 participants [nested] [flat]
* [PATCH v1 4/4] combine relopts correctly for VACUUM commands @ 2025-06-23 20:40 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2025-06-23 20:40 UTC (permalink / raw) --- src/backend/commands/vacuum.c | 30 +++++++++++++++++++---------- src/backend/postmaster/autovacuum.c | 2 +- src/include/commands/vacuum.h | 2 ++ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 0015b9ef4b0..a74c3a9e2a2 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -124,7 +124,7 @@ static void vac_truncate_clog(TransactionId frozenXID, TransactionId lastSaneFrozenXid, MultiXactId lastSaneMinMulti); static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, - BufferAccessStrategy bstrategy); + BufferAccessStrategy bstrategy, StdRdOptions *main_opts); static double compute_parallel_delay(void); static VacOptValue get_vacoptval_from_boolean(DefElem *def); static bool vac_tid_reaped(ItemPointer itemptr, void *state); @@ -634,7 +634,7 @@ vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, if (params->options & VACOPT_VACUUM) { - if (!vacuum_rel(vrel->oid, vrel->relation, params, bstrategy)) + if (!vacuum_rel(vrel->oid, vrel->relation, params, bstrategy, NULL)) continue; } @@ -1998,7 +1998,7 @@ vac_truncate_clog(TransactionId frozenXID, */ static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, - BufferAccessStrategy bstrategy) + BufferAccessStrategy bstrategy, StdRdOptions *main_opts) { LOCKMODE lmode; Relation rel; @@ -2008,6 +2008,8 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, Oid save_userid; int save_sec_context; int save_nestlevel; + StdRdOptions saved_opts; + StdRdOptions combined_opts; Assert(params != NULL); @@ -2165,6 +2167,15 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, lockrelid = rel->rd_lockInfo.lockRelId; LockRelationIdForSession(&lockrelid, lmode); + if (rel->rd_options) + { + memcpy(&saved_opts, rel->rd_options, sizeof(StdRdOptions)); + memcpy(&combined_opts, rel->rd_options, sizeof(StdRdOptions)); + + if (main_opts) + combine_relopts(&combined_opts, main_opts); + } + /* * Set index_cleanup option based on index_cleanup reloption if it wasn't * specified in VACUUM command, or when running in an autovacuum worker @@ -2176,8 +2187,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, if (rel->rd_options == NULL) vacuum_index_cleanup = STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO; else - vacuum_index_cleanup = - ((StdRdOptions *) rel->rd_options)->vacuum_index_cleanup; + vacuum_index_cleanup = combined_opts.vacuum_index_cleanup; if (vacuum_index_cleanup == STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO) params->index_cleanup = VACOPTVALUE_AUTO; @@ -2197,9 +2207,9 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, */ if (params->max_eager_freeze_failure_rate < 0 && rel->rd_options != NULL && - ((StdRdOptions *) rel->rd_options)->vacuum_max_eager_freeze_failure_rate >= 0) + combined_opts.vacuum_max_eager_freeze_failure_rate >= 0) params->max_eager_freeze_failure_rate = - ((StdRdOptions *) rel->rd_options)->vacuum_max_eager_freeze_failure_rate; + combined_opts.vacuum_max_eager_freeze_failure_rate; else params->max_eager_freeze_failure_rate = vacuum_max_eager_freeze_failure_rate; @@ -2211,9 +2221,9 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, { StdRdOptions *opts = (StdRdOptions *) rel->rd_options; - if (opts && opts->vacuum_truncate_set) + if (opts && combined_opts.vacuum_truncate_set) { - if (opts->vacuum_truncate) + if (combined_opts.vacuum_truncate) params->truncate = VACOPTVALUE_ENABLED; else params->truncate = VACOPTVALUE_DISABLED; @@ -2314,7 +2324,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, toast_vacuum_params.options |= VACOPT_PROCESS_MAIN; toast_vacuum_params.toast_parent = relid; - vacuum_rel(toast_relid, NULL, &toast_vacuum_params, bstrategy); + vacuum_rel(toast_relid, NULL, &toast_vacuum_params, bstrategy, &saved_opts); } /* diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 0d1f4e38b58..ca399b6a92e 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -1873,7 +1873,7 @@ get_database_list(void) return dblist; } -static void +void combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts) { AutoVacOpts *toast_avopts = &toast_opts->autovacuum; diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index bc37a80dc74..928f864581b 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -24,6 +24,7 @@ #include "parser/parse_node.h" #include "storage/buf.h" #include "storage/lock.h" +#include "utils/rel.h" #include "utils/relcache.h" /* @@ -377,6 +378,7 @@ extern IndexBulkDeleteResult *vac_cleanup_one_index(IndexVacuumInfo *ivinfo, /* In postmaster/autovacuum.c */ extern void AutoVacuumUpdateCostLimit(void); extern void VacuumUpdateCosts(void); +extern void combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts); /* in commands/vacuumparallel.c */ extern ParallelVacuumState *parallel_vacuum_init(Relation rel, Relation *indrels, -- 2.39.5 (Apple Git-154) --QWBYbd5Ar5k8NvSv-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* [PATCH v1 1/1] remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) --- src/backend/utils/activity/wait_event.c | 29 ++++++------------------- src/tools/pgindent/typedefs.list | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index 95635c7f56c..7ee6f99fb50 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -81,14 +81,7 @@ typedef struct WaitEventCustomEntryByName /* dynamic allocation counter for custom wait events */ -typedef struct WaitEventCustomCounterData -{ - int nextId; /* next ID to assign */ - slock_t mutex; /* protects the counter */ -} WaitEventCustomCounterData; - -/* pointer to the shared memory */ -static WaitEventCustomCounterData *WaitEventCustomCounter; +static int *WaitEventCustomCounter; /* first event ID of custom wait events */ #define WAIT_EVENT_CUSTOM_INITIAL_ID 1 @@ -110,8 +103,8 @@ const ShmemCallbacks WaitEventCustomShmemCallbacks = { static void WaitEventCustomShmemRequest(void *arg) { - ShmemRequestStruct(.name = "WaitEventCustomCounterData", - .size = sizeof(WaitEventCustomCounterData), + ShmemRequestStruct(.name = "WaitEventCustomCounter", + .size = sizeof(int), .ptr = (void **) &WaitEventCustomCounter, ); ShmemRequestHash(.name = "WaitEventCustom hash by wait event information", @@ -134,9 +127,8 @@ WaitEventCustomShmemRequest(void *arg) static void WaitEventCustomShmemInit(void *arg) { - /* initialize the allocation counter and its spinlock. */ - WaitEventCustomCounter->nextId = WAIT_EVENT_CUSTOM_INITIAL_ID; - SpinLockInit(&WaitEventCustomCounter->mutex); + /* initialize the allocation counter */ + *WaitEventCustomCounter = WAIT_EVENT_CUSTOM_INITIAL_ID; } /* @@ -221,19 +213,12 @@ WaitEventCustomNew(uint32 classId, const char *wait_event_name) } /* Allocate a new event Id */ - SpinLockAcquire(&WaitEventCustomCounter->mutex); - - if (WaitEventCustomCounter->nextId >= WAIT_EVENT_CUSTOM_HASH_SIZE) - { - SpinLockRelease(&WaitEventCustomCounter->mutex); + if (*WaitEventCustomCounter >= WAIT_EVENT_CUSTOM_HASH_SIZE) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many custom wait events")); - } - - eventId = WaitEventCustomCounter->nextId++; - SpinLockRelease(&WaitEventCustomCounter->mutex); + eventId = (*WaitEventCustomCounter)++; /* Register the new wait event */ wait_event_info = classId | eventId; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index ffb413ab612..3174e0e4ab8 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3418,7 +3418,6 @@ WaitEvent WaitEventActivity WaitEventBuffer WaitEventClient -WaitEventCustomCounterData WaitEventCustomEntryByInfo WaitEventCustomEntryByName WaitEventIO -- 2.50.1 (Apple Git-155) --65l7A33W789+zwjF-- ^ permalink raw reply [nested|flat] 197+ messages in thread
* remove WaitEventCustomCounterData @ 2026-07-09 02:50 Nathan Bossart <[email protected]> 0 siblings, 1 reply; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 02:50 UTC (permalink / raw) To: pgsql-hackers; +Cc: [email protected] While trying to understand the extent of our spinlock usage, I noticed that WaitEventCustomCounterData->mutex is unnecessary because the counter is only ever accessed with WaitEventCustomLock held exclusively. So, here's a patch to simplify matters a bit. Thoughts? -- nathan ^ permalink raw reply [nested|flat] 197+ messages in thread
* Re: remove WaitEventCustomCounterData @ 2026-07-09 04:04 Michael Paquier <[email protected]> parent: Nathan Bossart <[email protected]> 0 siblings, 1 reply; 197+ messages in thread From: Michael Paquier @ 2026-07-09 04:04 UTC (permalink / raw) To: Nathan Bossart <[email protected]>; +Cc: pgsql-hackers On Wed, Jul 08, 2026 at 09:50:33PM -0500, Nathan Bossart wrote: > While trying to understand the extent of our spinlock usage, I noticed that > WaitEventCustomCounterData->mutex is unnecessary because the counter is > only ever accessed with WaitEventCustomLock held exclusively. So, here's a > patch to simplify matters a bit. Thoughts? Indeed. This removal sounds good to me, thanks. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 197+ messages in thread
* Re: remove WaitEventCustomCounterData @ 2026-07-09 04:22 Fujii Masao <[email protected]> parent: Michael Paquier <[email protected]> 0 siblings, 1 reply; 197+ messages in thread From: Fujii Masao @ 2026-07-09 04:22 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Nathan Bossart <[email protected]>; pgsql-hackers On Thu, Jul 9, 2026 at 1:04 PM Michael Paquier <[email protected]> wrote: > > On Wed, Jul 08, 2026 at 09:50:33PM -0500, Nathan Bossart wrote: > > While trying to understand the extent of our spinlock usage, I noticed that > > WaitEventCustomCounterData->mutex is unnecessary because the counter is > > only ever accessed with WaitEventCustomLock held exclusively. So, here's a > > patch to simplify matters a bit. Thoughts? > > Indeed. This removal sounds good to me, thanks. #include "storage/spin.h" seems no longer needed in wait_event.c, since the patch removes the last use of the spinlock code there. So we can remove that include as well? Regards, -- Fujii Masao ^ permalink raw reply [nested|flat] 197+ messages in thread
* Re: remove WaitEventCustomCounterData @ 2026-07-09 16:10 Nathan Bossart <[email protected]> parent: Fujii Masao <[email protected]> 0 siblings, 0 replies; 197+ messages in thread From: Nathan Bossart @ 2026-07-09 16:10 UTC (permalink / raw) To: Fujii Masao <[email protected]>; +Cc: Michael Paquier <[email protected]>; pgsql-hackers On Thu, Jul 09, 2026 at 01:22:52PM +0900, Fujii Masao wrote: > #include "storage/spin.h" seems no longer needed in wait_event.c, > since the patch removes the last use of the spinlock code there. > So we can remove that include as well? I think so. I've committed the patch with that change. Thanks for looking! -- nathan ^ permalink raw reply [nested|flat] 197+ messages in thread
end of thread, other threads:[~2026-07-09 16:10 UTC | newest] Thread overview: 197+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-06-23 20:40 [PATCH v1 4/4] combine relopts correctly for VACUUM commands Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 [PATCH v1 1/1] remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 02:50 remove WaitEventCustomCounterData Nathan Bossart <[email protected]> 2026-07-09 04:04 ` Re: remove WaitEventCustomCounterData Michael Paquier <[email protected]> 2026-07-09 04:22 ` Re: remove WaitEventCustomCounterData Fujii Masao <[email protected]> 2026-07-09 16:10 ` Re: remove WaitEventCustomCounterData Nathan Bossart <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox