model-writtenrun 1922 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ashutosh Bapat proposed moving semaphore reservation into shared-memory structure initialization and using ShmemAlloc(), explaining that removal of semaphore-backed spinlocks had eliminated the old ordering constraint; he reported successful Ubuntu regression tests and identified shared-buffer resizing as a motivation #1.
- Thomas Munro confirmed that the cleanup opportunity had been missed and proposed a comment-only fix for PostgreSQL 18 followed by the functional refactoring on master #2.
- Ashutosh supplied both patches, moving semaphore reservation into InitProcGlobal(), accounting for its memory in ProcGlobalShmemSize(), and removing the semaphore-count output from CalculateShmemSize(); he mentioned but left out converting ProcGlobalSemas() into a macro or inline function #3.
- Heikki Linnakangas said the patches looked good and allowed Thomas additional time to review before committing #4.
- Heikki committed the explanatory comment from #3 with shorter wording as daf3d99d2b, including a PostgreSQL 18 backpatch, and committed the refactoring as aa9c5fd3e3, additionally correcting the CalculateShmemSize() comment and making ShmemAllocUnlocked() static #5.
- After both commits, Chao Li suggested identifying non-Windows platforms explicitly in the comment and skipping semaphore shared-memory accounting on Windows #7.
- Ashutosh replied that platform-specific wording could become misleading and that the Windows size calculation already returns zero, leaving both patches committed with no further fix attached #8.