diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-06 23:08:34 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-06 23:08:34 +0000 |
| commit | 887a7c61f630b743f12a06b859ac1d03d2fb2bb9 (patch) | |
| tree | 7554bb3c604e3e4f1a780b06c52f78bbbf73f8f2 /src/backend/storage | |
| parent | 3001b4697d5233b5ea7b4612283e720835338d92 (diff) | |
| download | postgresql-887a7c61f630b743f12a06b859ac1d03d2fb2bb9.tar.gz | |
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.
Diffstat (limited to 'src/backend/storage')
| -rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 5526c77a67..a215a65285 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -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; |
