Re: Fw: [vorbis-dev] ogg123: shared memory by mmap()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alfred Perlstein <bright(at)wintelcom(dot)net>
Cc: Rod Taylor <rod(dot)taylor(at)inquent(dot)com>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fw: [vorbis-dev] ogg123: shared memory by mmap()
Date: 2001-03-20 22:10:33
Message-ID: 200103202210.RAA23981@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > The patch below adds:
> > >
> > > - acinclude.m4: A new macro A_FUNC_SMMAP to check that sharing
> > pages
> > > through mmap() works. This is taken from Joerg Schilling's star.
> > > - configure.in: A_FUNC_SMMAP
> > > - ogg123/buffer.c: If we have a working mmap(), use it to create
> > > a region of shared memory instead of using System V IPC.
> > >
> > > Works on BSD. Should also work on SVR4 and offspring (Solaris),
> > > and Linux.
>
> This is a really bad idea performance wise. Solaris has a special
> code path for SYSV shared memory that doesn't require tons of swap
> tracking structures per-page/per-process. FreeBSD also has this
> optimization (it's off by default, but should work since FreeBSD
> 4.2 via the sysctl kern.ipc.shm_use_phys=1)

>
> Both OS's use a trick of making the pages non-pageable, this allows
> signifigant savings in kernel space required for each attached
> process, as well as the use of large pages which reduce the amount
> of TLB faults your processes will incurr.

That is interesting. BSDi has SysV shared memory as non-pagable, and I
always thought of that as a bug. Seems you are saying that having it
pagable has a significant performance penalty. Interesting.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2001-03-20 22:10:57 Re: More on elog and error codes
Previous Message Bruce Momjian 2001-03-20 22:04:38 Re: /contrib 'cosmetic'