mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Get rid of slru.c's hardwired insistence on a fixed number of slots per
SLRU area. The number of slots is still a compile-time constant (someday we might want to change that), but at least it's a different constant for each SLRU area. Increase number of subtrans buffers to 32 based on experimentation with a heavily subtrans-bashing test case, and increase number of multixact member buffers to 16, since it's obviously silly for it not to be at least twice the number of multixact offset buffers.
This commit is contained in:
@@ -15,13 +15,15 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.34 2005/10/15 02:49:26 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.35 2005/12/06 23:08:33 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "access/slru.h"
|
||||
#include "access/clog.h"
|
||||
#include "access/multixact.h"
|
||||
#include "access/subtrans.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/proc.h"
|
||||
#include "storage/spin.h"
|
||||
@@ -129,16 +131,13 @@ NumLWLocks(void)
|
||||
numLocks += 2 * NBuffers;
|
||||
|
||||
/* clog.c needs one per CLOG buffer */
|
||||
numLocks += NUM_SLRU_BUFFERS;
|
||||
numLocks += NUM_CLOG_BUFFERS;
|
||||
|
||||
/* subtrans.c needs one per SubTrans buffer */
|
||||
numLocks += NUM_SLRU_BUFFERS;
|
||||
numLocks += NUM_SUBTRANS_BUFFERS;
|
||||
|
||||
/*
|
||||
* multixact.c needs one per MultiXact buffer, but there are two SLRU
|
||||
* areas for MultiXact
|
||||
*/
|
||||
numLocks += 2 * NUM_SLRU_BUFFERS;
|
||||
/* multixact.c needs two SLRU areas */
|
||||
numLocks += NUM_MXACTOFFSET_BUFFERS + NUM_MXACTMEMBER_BUFFERS;
|
||||
|
||||
/* Leave a few extra for use by user-defined modules. */
|
||||
numLocks += NUM_USER_DEFINED_LWLOCKS;
|
||||
|
||||
Reference in New Issue
Block a user