| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> | 
|---|---|
| To: | Josh Wilmes <jwilmes(at)cisco(dot)com> | 
| Cc: | pgsql-bugs(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org, Nick Johnson <njohnson(at)cisco(dot)com> | 
| Subject: | Re: ISM shared memory on solaris | 
| Date: | 2003-10-24 15:47:36 | 
| Message-ID: | 200310241547.h9OFlaV01807@candle.pha.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs pgsql-patches | 
Yikes!  We thought we were already using ISM on Solaris.
Would you test the attached patch?  It uses _solaris_ rather than
SHM_SHARE_MMU in the define test.  Does that work too?
---------------------------------------------------------------------------
Josh Wilmes wrote:
> I hope this is the right place to send this.. the FAQ in the 
> distribution mentions http://www.PostgreSQL.org/bugs/bugs.php, which 
> doesn't work.
> 
> We've found that postgresql wasn't using ISM shared memory on solaris, 
> which theoretically would cost performance.   The root cause in our case 
> was that the "solaris" define is not defined by our compilers or by 
> postgresql itself.
> 
> The patch below simple has it check SHM_SHARE_MMU instead, which should 
> work fine.   I verified (with 'pmap') that the database is now using ISM 
>   on its shared memory, after this patch was applied.
> 
> --Josh
> 
> 
> 
> --- sysv_shmem.c.orig   2002-09-04 13:31:24.000000000 -0700
> +++ sysv_shmem.c        2003-10-23 12:52:26.756765000 -0700
> @@ -143,7 +143,7 @@
>          on_shmem_exit(IpcMemoryDelete, Int32GetDatum(shmid));
> 
>          /* OK, should be able to attach to the segment */
> -#if defined(solaris) && defined(__sparc__)
> +#if defined(SHM_SHARE_MMU) && defined(__sparc__)
>          /* use intimate shared memory on SPARC Solaris */
>          memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
>   #else
> @@ -323,8 +323,8 @@
>                  shmid = shmget(NextShmemSegID, sizeof(PGShmemHeader), 0);
>                  if (shmid < 0)
>                          continue;                       /* failed: must 
> be some other app's */
> -
> -#if defined(solaris) && defined(__sparc__)
> +
> +#if defined(SHM_SHARE_MMU) && defined(__sparc__)
>                  /* use intimate shared memory on SPARC Solaris */
>                  memAddress = shmat(shmid, 0, SHM_SHARE_MMU);
>   #else
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>       message can get through to the mailing list cleanly
> 
-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
| Attachment | Content-Type | Size | 
|---|---|---|
| unknown_filename | text/plain | 1.4 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Wilmes | 2003-10-24 16:01:25 | Re: ISM shared memory on solaris | 
| Previous Message | Stephan Szabo | 2003-10-24 05:41:17 | Re: currval and nextval in 7.3.4 | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Wilmes | 2003-10-24 16:01:25 | Re: ISM shared memory on solaris | 
| Previous Message | Bruce Momjian | 2003-10-24 03:19:35 | Re: two-phase commit |