Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b73859d

Browse files
committed
Patch against 7.2.1 sources. Uses Solaris Intimate Shared Memory
for Solaris on SPARC. Scott Brunza ([email protected]) 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
1 parent 291c875 commit b73859d

File tree

1 file changed

+15
-3
lines changed
  • src/backend/storage/ipc

1 file changed

+15
-3
lines changed

src/backend/storage/ipc/ipc.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.77 2002/03/06 06:10:05 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.78 2002/04/13 19:52:51 momjian Exp $
1212
*
1313
* NOTES
1414
*
@@ -632,7 +632,12 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
632632
on_shmem_exit(IpcMemoryDelete, Int32GetDatum(shmid));
633633

634634
/* OK, should be able to attach to the segment */
635-
memAddress = shmat(shmid, 0, 0);
635+
#if defined(solaris) && defined(__sparc__)
636+
/* use intimate shared memory on SPARC Solaris */
637+
memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
638+
#else
639+
memAddress = shmat(shmid, 0, 0);
640+
#endif
636641

637642
if (memAddress == (void *) -1)
638643
{
@@ -812,7 +817,14 @@ IpcMemoryCreate(uint32 size, bool makePrivate, int permission)
812817
shmid = shmget(NextShmemSegID, sizeof(PGShmemHeader), 0);
813818
if (shmid < 0)
814819
continue; /* failed: must be some other app's */
815-
memAddress = shmat(shmid, 0, 0);
820+
821+
#if defined(solaris) && defined(__sparc__)
822+
/* use intimate shared memory on SPARC Solaris */
823+
memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
824+
#else
825+
memAddress = shmat(shmid, 0, 0);
826+
#endif
827+
816828
if (memAddress == (void *) -1)
817829
continue; /* failed: must be some other app's */
818830
hdr = (PGShmemHeader *) memAddress;

0 commit comments

Comments
 (0)