aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/multixact.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-12-06 23:08:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-12-06 23:08:34 +0000
commit887a7c61f630b743f12a06b859ac1d03d2fb2bb9 (patch)
tree7554bb3c604e3e4f1a780b06c52f78bbbf73f8f2 /src/backend/access/transam/multixact.c
parent3001b4697d5233b5ea7b4612283e720835338d92 (diff)
downloadpostgresql-887a7c61f630b743f12a06b859ac1d03d2fb2bb9.tar.gz
postgresql-887a7c61f630b743f12a06b859ac1d03d2fb2bb9.zip
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/access/transam/multixact.c')
-rw-r--r--src/backend/access/transam/multixact.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 3e8f86818f3..1862d188b37 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -42,7 +42,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.14 2005/12/06 18:10:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.15 2005/12/06 23:08:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1249,8 +1249,8 @@ MultiXactShmemSize(void)
mul_size(sizeof(MultiXactId) * 2, MaxBackends))
size = SHARED_MULTIXACT_STATE_SIZE;
- size = add_size(size, SimpleLruShmemSize());
- size = add_size(size, SimpleLruShmemSize());
+ size = add_size(size, SimpleLruShmemSize(NUM_MXACTOFFSET_BUFFERS));
+ size = add_size(size, SimpleLruShmemSize(NUM_MXACTMEMBER_BUFFERS));
return size;
}
@@ -1265,9 +1265,11 @@ MultiXactShmemInit(void)
MultiXactOffsetCtl->PagePrecedes = MultiXactOffsetPagePrecedes;
MultiXactMemberCtl->PagePrecedes = MultiXactMemberPagePrecedes;
- SimpleLruInit(MultiXactOffsetCtl, "MultiXactOffset Ctl",
+ SimpleLruInit(MultiXactOffsetCtl,
+ "MultiXactOffset Ctl", NUM_MXACTOFFSET_BUFFERS,
MultiXactOffsetControlLock, "pg_multixact/offsets");
- SimpleLruInit(MultiXactMemberCtl, "MultiXactMember Ctl",
+ SimpleLruInit(MultiXactMemberCtl,
+ "MultiXactMember Ctl", NUM_MXACTMEMBER_BUFFERS,
MultiXactMemberControlLock, "pg_multixact/members");
/* Initialize our shared state struct */