From: Ron Natalie <ron@sensor.com>
Subject: Re: vfork on Dec Alpha buggy?
Date: 1996/12/18 [thread overview]
Message-ID: <32B819A2.111F@sensor.com> (raw)
In-Reply-To: E2M7CL.4q3@hermes.hrz.uni-bielefeld.de
VFORK isn't buggy on the ALPHA, it is absent entirely.
An unfortunate decision on DEC's part. The reason VFORK
is there at all is a kludge. Most UNIX commands do an
exec shortly after the fork. Unfortunately, fork causes
a complete duplication of the writable parts of the process.
Berkeley added VFORK to make the fork-then-exec paradigm
feature work efficiently. You were warned in the manual
page to be very, very, careful with this.
On machines with decent virtual memory systems, you can
set up the forked process to be copy-on-access from the
parent. This greatly succeeds in making the fork-then-
exec efficient as only the pages that are touched prior
to forking need to be copied. DEC and SGI are two of
the implementations that do this and have just replaced
vfork with fork.
Unfortunately, another problem looms it's ugly head.
Stupid swap space allocation. Many systems implement
a immediate swap reservation when a process starts (fork).
Now if you try to fork something trivial off from a large
VM process, things may die because the OS allocates enough
swap for another copy of the big process, when all that
is being started is some little program.
Fortunately, on the DEC you can get around this by turning
on lazy swap allocation (see the description of /etc/swapdefauts
in the swapon man page). However, much as I detest kludges,
I wish DEC would have left VFORK well enough alone.
-Ron
next prev parent reply other threads:[~1996-12-18 5:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-12-18 5:00 vfork on Dec Alpha buggy? Carsten Hammer
1996-12-18 5:00 ` Ron Natalie [this message]
1996-12-18 5:00 ` Pierre Asselin
1996-12-19 5:00 ` T. Horsnell (tsh)
1996-12-19 5:00 ` Ron Natalie
1996-12-19 5:00 ` Burkhard Neidecker-Lutz
1996-12-21 5:00 ` Linus Torvalds
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox