[comp.unix.ultrix] mmap

time@oxtrap.UUCP (Tim Endres) (06/11/89)

Thank you to several who replied to my mmap() question.

It appears that mmap() is not supported by Dec for the
DecStation 3100 ultrix. The call is there. You can link
it in, but it *always* returns 0, and it *never* seems
to function. Too bad. mmap() is a very important function
to not implement.

The question now: How can we get a 4Meg System V shared memory segment?

Our shared memory needs are 4 Megabytes. We could break the segment up
but the re-write is too costly right now. Someone at Dec indicated that
the limit on the size of SysV shared memory segments is configurable.

Does anyone have experience increasing the SystemV shared memory segment
size limit?
Does anyone know if there is a *hard* maximum size?

Tim.

grr@cbmvax.UUCP (George Robbins) (06/12/89)

In article <6514@oxtrap.UUCP> time@oxtrap.UUCP (Tim Endres) writes:
> Thank you to several who replied to my mmap() question.
> 
> The question now: How can we get a 4Meg System V shared memory segment?
> 
> Our shared memory needs are 4 Megabytes. We could break the segment up
> but the re-write is too costly right now. Someone at Dec indicated that
> the limit on the size of SysV shared memory segments is configurable.

The following items in the /sys/h/param.h include file control the
shared memory configuration.  You can override the default values by
putting control lines in your config file, /sys/conf/YOURSYSTEM.
There are no obvious hard limits but some common sense is advised,
and the numbers must fit the shared memory segments between the
top of the amount of memory occupied by your largest text/data
segment plus as much memory as it malloc's and the bottom of the
stack...

*****  the following numbers are vax stuff, check if 3100 is different! *****

from (loosely) /sys/h/param.h:

/*
 * SMMAX, SMMIN and SMBRK are 512 byte pages.  SMMAX is rounded up to bytes
 * on a cluster boundary.  SMMIN is truncated down to bytes on a cluster
 * boundary.  SMBRK is rounded up to a cluster boundary.
 */

#define	SMSEG	6	/* number of segments per process */
#define	SMMAX	256	   /* Max SM segment size (512 byte pages) */
#define	SMMIN	0	   /* Min SM segment size (512 byte pages) */
#define	SMBRK	64	   /* separation between end of data and
			      beginning of SM segments (512 byte pages) */
#define	MAXSMAT	(SMSMAT*1024*1024) /* highest shared memory attach addr
					( in meg ) */


lines in /sys/conf/YOURSYSTEM for "default values":

smmax	256
smmin	0
smbrk	64
smseg	6
smsmat	21	# approximate

As usual, just because you can change them, there is no guarantee that
something won't break if you choose imaginative values.

Note that 'smmax 256' should be  roughly equivalent to 'options "SMMAX=256"'
if you are inclined to play with things that aren't hardwired into /etc/config.

-- 
George Robbins - now working for,	uucp: {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@uunet.uu.net
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)