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

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: Fw: [vorbis-dev] ogg123: shared memory by mmap()
Дата
Msg-id 20010320154410.H29888@fw.wintelcom.net
обсуждение исходный текст
Ответ на Re: Fw: [vorbis-dev] ogg123: shared memory by mmap()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
* Bruce Momjian <pgman@candle.pha.pa.us> [010320 14:10] wrote:
> > > > 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.

Yes, having it pageable is actually sort of bad.

It doesn't allow you to do several important optimizations.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: pg_inherits: not found, but visible
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: Beta 6 Regression results on Redat 7.0.