Mail Archives: cygwin/2004/07/26/04:30:53
On Jul 25 12:58, Gene C. Ruzicka wrote:
> A code I'm porting to Cygwin requires tuning the
> size of the shareable memory segment to obtain
> optimal performance.  I am using cygserver to
> access IPC utilities.  
> 
> cygserver.conf doesn't allow one to set the maximum shareable 
> segment size, SHMMAX directly.  Instead, it seems SHMMAX
> is set in this code fragment in function shminit in cygserver:
> 
>  int i;
>  TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall);
>  for (i = PAGE_SIZE; i > 0; i--) {
>   shminfo.shmmax = shminfo.shmall * PAGE_SIZE;
>   if (shminfo.shmmax >= shminfo.shmall)
>    break;
>  }
> 
> Thus, SHMMAX = SHMMAXPGS*PAGE_SIZE , in which
> SHMMAXPGS is configurable in cygserver.conf, and PAGE_SIZE
> is the system's page size.  So, this suggests that if you have to set
> SHMMAXPGS in order to set SHMMAX. Is this correct?
Yes.
> Further comment: Uncovering this information was somewhat painful.
Didn't you read /usr/share/doc/Cygwin/cygserver.README and in turn
/etc/cygserver.conf in the first place?  The configuration file contains
the comment
  "kern.ipc.shmmaxpgs: Maximum pages available for XSI shared memory."
I thought that explains it.
Corinna
-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
- Raw text -