summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-06-27 23:31:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-06-27 23:31:40 +0000
commite0c9301c87634f21c0a7c6305bdc6da15d6ba375 (patch)
treeaad976ca0197137c3461ff19a3d0e155487f7b44 /src/backend/storage/ipc
parentb559382134a52bbe1d79d465afd89c8385f88581 (diff)
downloadpostgresql-e0c9301c87634f21c0a7c6305bdc6da15d6ba375.tar.gz
Install infrastructure for shared-memory free space map. Doesn't actually
do anything yet, but it has the necessary connections to initialization and so forth. Make some gestures towards allowing number of blocks in a relation to be BlockNumber, ie, unsigned int, rather than signed int. (I doubt I got all the places that are sloppy about it, yet.) On the way, replace the hardwired NLOCKS_PER_XACT fudge factor with a GUC variable.
Diffstat (limited to 'src/backend/storage/ipc')
-rw-r--r--src/backend/storage/ipc/ipci.c16
-rw-r--r--src/backend/storage/ipc/spin.c27
2 files changed, 26 insertions, 17 deletions
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index ed42e51a92..75736c8f24 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.40 2001/03/22 03:59:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.41 2001/06/27 23:31:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -19,6 +19,7 @@
#include "miscadmin.h"
#include "access/xlog.h"
#include "storage/bufmgr.h"
+#include "storage/freespace.h"
#include "storage/lmgr.h"
#include "storage/proc.h"
#include "storage/sinval.h"
@@ -47,8 +48,12 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends)
* moderately-accurate estimates for the big hogs, plus 100K for the
* stuff that's too small to bother with estimating.
*/
- size = BufferShmemSize() + LockShmemSize(maxBackends) +
- XLOGShmemSize() + SLockShmemSize() + SInvalShmemSize(maxBackends);
+ size = BufferShmemSize();
+ size += LockShmemSize(maxBackends);
+ size += XLOGShmemSize();
+ size += SLockShmemSize();
+ size += SInvalShmemSize(maxBackends);
+ size += FreeSpaceShmemSize();
#ifdef STABLE_MEMORY_STORAGE
size += MMShmemSize();
#endif
@@ -96,4 +101,9 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends)
* Set up shared-inval messaging
*/
CreateSharedInvalidationState(maxBackends);
+
+ /*
+ * Set up free-space map
+ */
+ InitFreeSpaceMap();
}
diff --git a/src/backend/storage/ipc/spin.c b/src/backend/storage/ipc/spin.c
index 33308f0cc1..05bf5acbbb 100644
--- a/src/backend/storage/ipc/spin.c
+++ b/src/backend/storage/ipc/spin.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.32 2001/03/22 03:59:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.33 2001/06/27 23:31:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,19 +31,18 @@
/* Probably should move these to an appropriate header file */
-extern SPINLOCK ShmemLock;
-extern SPINLOCK ShmemIndexLock;
extern SPINLOCK BufMgrLock;
-extern SPINLOCK LockMgrLock;
-extern SPINLOCK ProcStructLock;
-extern SPINLOCK SInvalLock;
extern SPINLOCK OidGenLockId;
extern SPINLOCK XidGenLockId;
extern SPINLOCK ControlFileLockId;
-
+extern SPINLOCK ShmemLock;
+extern SPINLOCK ShmemIndexLock;
+extern SPINLOCK LockMgrLock;
+extern SPINLOCK SInvalLock;
+extern SPINLOCK ProcStructLock;
+extern SPINLOCK FreeSpaceLock;
#ifdef STABLE_MEMORY_STORAGE
extern SPINLOCK MMCacheLock;
-
#endif
@@ -57,16 +56,16 @@ extern SPINLOCK MMCacheLock;
static void
InitSpinLockIDs(void)
{
- ShmemLock = (SPINLOCK) SHMEMLOCKID;
- ShmemIndexLock = (SPINLOCK) SHMEMINDEXLOCKID;
BufMgrLock = (SPINLOCK) BUFMGRLOCKID;
- LockMgrLock = (SPINLOCK) LOCKMGRLOCKID;
- ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID;
- SInvalLock = (SPINLOCK) SINVALLOCKID;
OidGenLockId = (SPINLOCK) OIDGENLOCKID;
XidGenLockId = (SPINLOCK) XIDGENLOCKID;
ControlFileLockId = (SPINLOCK) CNTLFILELOCKID;
-
+ ShmemLock = (SPINLOCK) SHMEMLOCKID;
+ ShmemIndexLock = (SPINLOCK) SHMEMINDEXLOCKID;
+ LockMgrLock = (SPINLOCK) LOCKMGRLOCKID;
+ SInvalLock = (SPINLOCK) SINVALLOCKID;
+ ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID;
+ FreeSpaceLock = (SPINLOCK) FREESPACELOCKID;
#ifdef STABLE_MEMORY_STORAGE
MMCacheLock = (SPINLOCK) MMCACHELOCKID;
#endif