httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eli Marmor <>
Subject Re: Linux and Shared Memory.. hell!
Date Mon, 01 May 2000 14:21:36 GMT
I forwarded the question to Moshe Bar, a friend of me. He writes
for, The Linux Journal, and others, about Linux internals
(including issues discussed in Ralf's question), and is also the
author of future books from O'Reilly about these issues. He is also
the head of khaOS distribution project.

Here are his answers; I hope they will help:
Hi Eli

Your friend raises a few interesting questions. Let me try to answer them

>    1. Linux since many years seems to have a broken MMANON support.
>       I never got this running. On a kernel 2.3.99 box it hangs
>       the process and causes a "ps" to hang later, too.
>       This means MM's --with-shm=MMANON cannot be used.

There's probably a bug somewhere if it hangs. Basically with latest 2.3.x
linux allows to do a MAP_ANON|MAP_SHARED and it will be supposed to work
on 2.4.x.

>    2. Linux (kernel 2.0) today showed to dislike even the
>       classic mmap() on /dev/zero variant. It allways returned with
>       EINVAL, independent how I prepare /dev/zero (ftruncate, lseek,
>       write, etc.) or what mapping size I use.
>       This means MM's --with-shm=MMZERO cannot be used.

2.0.x is obsolete in many more things ;).

But yes even in 2.2.x MMZERO is not allowed. In 2.3.x will be allowed.
However if MMANON breaks then MMZERO is going to break too... (see below

>    3. Linux (seems like kernel 2.2 or 2.3) requires a shm filesystem to
>       be mounted by the system admin in order to use IPC SHM.
>       This means MM's --with-shm=IPCSHM cannot be used all the time.

That will be fixed before 2.4.x (in 2.4.x you'll be alloed to shmget
without having to mount the fs).

2.2.x definitely doesn't need the shmfs to be mounted.

>    4. Linux lacks the POSIX shm_open stuff.
>       This means MM's --with-shm=MMPOSX cannot be used at all.

This is in 2.3.x and I think it will be supported when the shmfs is
mounted. So you also see the shm poxis namespace in a filesystem and you
can threat the memory like a file (read/write to it trasparently).

In 2.2.x only IPCSHM is supported.

In 2.3.x all four methods you mentioned are supported. All four methods
fallbacks in the _same_ old VM code of the IPCSHM (so for VM internals all
the memory will be seen as IPC SHM). Only the interface to userspace on
how to handle the SHM changes. If some method doesn't yet work well there
may be a bug... ;)

Eli Marmor

View raw message