pgsql: Remove --disable-spinlocks.

Started by Thomas Munroover 2 years ago3 messagescommitters
Jump to latest
#1Thomas Munro
tmunro@postgresql.org

Remove --disable-spinlocks.

A later change will require atomic support, so it wouldn't make sense
for a hypothetical new system not to be able to implement spinlocks.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (concept, not the patch)
Reviewed-by: Andres Freund <andres@anarazel.de> (concept, not the patch)
Discussion: /messages/by-id/3351991.1697728588@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
configure | 40 -------
configure.ac | 13 ---
doc/src/sgml/installation.sgml | 37 +------
meson.build | 6 --
src/backend/port/atomics.c | 26 -----
src/backend/port/posix_sema.c | 3 +-
src/backend/port/sysv_sema.c | 3 +-
src/backend/postmaster/launch_backend.c | 8 --
src/backend/storage/ipc/ipci.c | 10 --
src/backend/storage/lmgr/Makefile | 1 -
src/backend/storage/lmgr/meson.build | 1 -
src/backend/storage/lmgr/s_lock.c | 2 +-
src/backend/storage/lmgr/spin.c | 180 --------------------------------
src/include/pg_config.h.in | 3 -
src/include/pg_config_manual.h | 15 ---
src/include/port/atomics.h | 4 +-
src/include/port/atomics/fallback.h | 4 +-
src/include/storage/s_lock.h | 39 +------
src/include/storage/spin.h | 18 +---
src/test/regress/regress.c | 86 ---------------
20 files changed, 13 insertions(+), 486 deletions(-)

#2Heikki Linnakangas
hlinnaka@iki.fi
In reply to: Thomas Munro (#1)
Re: pgsql: Remove --disable-spinlocks.

On 30/07/2024 14:03, Thomas Munro wrote:

Remove --disable-spinlocks.

Sorry, spotted this only now:

--- a/src/backend/postmaster/launch_backend.c
+++ b/src/backend/postmaster/launch_backend.c
@@ -108,9 +108,7 @@ typedef struct
#ifdef USE_INJECTION_POINTS
struct InjectionPointsCtl *ActiveInjectionPoints;
#endif
-#ifndef HAVE_SPINLOCKS
PGSemaphore *SpinlockSemaArray;
-#endif
int         NamedLWLockTrancheRequests;
NamedLWLockTranche *NamedLWLockTrancheArray;
LWLockPadded *MainLWLockArray;

The SpinLockSemaArray field should be completely completely, nut just
the #ifndef guard around it.

--
Heikki Linnakangas
Neon (https://neon.tech)

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Heikki Linnakangas (#2)
Re: pgsql: Remove --disable-spinlocks.

On Tue, Jul 30, 2024 at 11:09 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:

The SpinLockSemaArray field should be completely completely, nut just
the #ifndef guard around it.

Looks like I had that right in the first version, but got confused
while rebasing over a conflict. Fixed, thanks!