[wellylug] /dev/anon [was Forking Linux.]
David Antliff
dave.antliff at paradise.net.nz
Wed Nov 10 17:19:14 NZDT 2004
On Wed, 10 Nov 2004, Donald Gordon wrote:
> It lets it allocate anonymous mmapable memory. Otherwise it has to open
> files in /tmp, mmap them, and unlink them. Which, if /tmp is on disk,
> can be slow, and if it's tmpfs, you may run out of space (*cough*).
Yes, I came across this recently while trying to be clever with 'zexec'
(from Minix) and tmpfs. Unfortunately the blocks aren't freed until the
executing program finishes. It was a complicated situation involving
limited RAM and limited storage, so I won't go into it except to say that
I ended up putting the programs into a cramfs 'bubble' and mounting them
on loopback before execution ;) The driver decompresses the pages on the
fly and since the system isn't using swappable pages (and they're
read-only) the performance hit doesn't seem to be a problem (presumably
once the kernel has read them it they don't get paged out so it never has
to read them again). The only thing I wasn't able to work out is if the
entire application is loaded into the working set before it starts
executing...
/dev/anon sounds interesting however. Hmmm...
--
David.
More information about the wellylug
mailing list