aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-04-13 19:52:51 +0000
committerBruce Momjian <bruce@momjian.us>2002-04-13 19:52:51 +0000
commitb73859db8c94ca061a31aae2fae21a12c87c085d (patch)
treeff8a78537a706b05f892087cfa42108b52949981
parent291c875f239cd6a5238955eaef234d476103c8da (diff)
downloadpostgresql-b73859db8c94ca061a31aae2fae21a12c87c085d.tar.gz
postgresql-b73859db8c94ca061a31aae2fae21a12c87c085d.zip
Patch against 7.2.1 sources. Uses Solaris Intimate Shared Memory
for Solaris on SPARC. Scott Brunza (sbrunza@sonalysts.com) gets credit for identifying the issue, making the change, and doing the regression tests. Earlier testing on 7.2rc2 and 7.2 showed performance gains of 1% to 10% on pgbench, osdb-pg, and some locally developed apps. Solaris Intimate Shared Memory is described in "SOLARIS INTERNALS Core Kernel Components" by Jim Mauro and Richard McDougall, Copyright 2001 Sun Microsystem, Inc. ISBN 0-13-022496-0 P.J. "Josh" Rovero
-rw-r--r--src/backend/storage/ipc/ipc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index ad351542347..10d3d6e7edb 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.77 2002/03/06 06:10:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.78 2002/04/13 19:52:51 momjian Exp $
*
* NOTES
*
@@ -632,7 +632,12 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
on_shmem_exit(IpcMemoryDelete, Int32GetDatum(shmid));
/* OK, should be able to attach to the segment */
- memAddress = shmat(shmid, 0, 0);
+#if defined(solaris) && defined(__sparc__)
+ /* use intimate shared memory on SPARC Solaris */
+ memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
+#else
+ memAddress = shmat(shmid, 0, 0);
+#endif
if (memAddress == (void *) -1)
{
@@ -812,7 +817,14 @@ IpcMemoryCreate(uint32 size, bool makePrivate, int permission)
shmid = shmget(NextShmemSegID, sizeof(PGShmemHeader), 0);
if (shmid < 0)
continue; /* failed: must be some other app's */
- memAddress = shmat(shmid, 0, 0);
+
+#if defined(solaris) && defined(__sparc__)
+ /* use intimate shared memory on SPARC Solaris */
+ memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
+#else
+ memAddress = shmat(shmid, 0, 0);
+#endif
+
if (memAddress == (void *) -1)
continue; /* failed: must be some other app's */
hdr = (PGShmemHeader *) memAddress;