1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

Split the buffer mapping table into multiple separately lockable

partitions, as per discussion.  Passes functionality checks, but
I don't have any performance data yet.
This commit is contained in:
Tom Lane
2006-07-23 03:07:58 +00:00
parent 51ee9fa157
commit 10b9ca3d05
8 changed files with 198 additions and 75 deletions

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.40 2006/07/14 14:52:23 momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.41 2006/07/23 03:07:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,10 +157,7 @@ NumLWLocks(void)
*/
/* Predefined LWLocks */
numLocks = (int) FirstLockMgrLock;
/* lock.c gets the ones starting at FirstLockMgrLock */
numLocks += NUM_LOCK_PARTITIONS;
numLocks = (int) NumFixedLWLocks;
/* bufmgr.c needs two for each shared buffer */
numLocks += 2 * NBuffers;
@@ -239,11 +236,10 @@ CreateLWLocks(void)
/*
* Initialize the dynamic-allocation counter, which is stored just before
* the first LWLock. The LWLocks used by lock.c are not dynamically
* allocated, it just assumes it has them.
* the first LWLock.
*/
LWLockCounter = (int *) ((char *) LWLockArray - 2 * sizeof(int));
LWLockCounter[0] = (int) FirstLockMgrLock + NUM_LOCK_PARTITIONS;
LWLockCounter[0] = (int) NumFixedLWLocks;
LWLockCounter[1] = numLocks;
}