NOSLEEP in Sys V.3.1 fork.c

Ron Guilmette rfg at nsc.nsc.com
Fri Aug 26 05:05:20 AEST 1988


Are there any System V.3.1 kernel hackers out there who can answer this
question about the V.3.1 fork() implementation?

I noticed that on one system we have configured with 4 MB of memory (small by
our current standards), I was often getting "no more processes" whenever there
was somebody else on the system doing something which used up most of the
available real memory.  (The kernel itself uses a big chunk of course).

I investigated and found out that the System V.3.1 "fork.c" makes a call to
dupreg() (duplicate region) to create the child process, but it passes in the
NOSLEEP parameter so that it will NEVER WAIT for other processes to swap out.
Instead the fork just fails, returning -1!  Note that the BSD 4.3 fork() is
very different and it seems to be willing to wait for space to become available
via swaping.

I though that V.3.1 code was pretty stupid so I removed the NOSLEEP and now I
can get many more processes with the same memory configuration.  Unfortunately,
when I now run my "fork_limit" test program (which just forks as many children
as it can) the system will eventually slow down untill it is useless and has
to be rebooted.

I'd like to know if other people have seen and/or solved these problems.

Ron Guilmette
National SemiConductor
Internet: rfg at nsc.nsc.com   or   amdahl!nsc!rfg at ames.arc.nasa.gov
Uucp: ...{pyramid,sun,amdahl,apple}!nsc!rfg
-- 
Ron Guilmette
National SemiConductor
Internet: rfg at nsc.nsc.com   or   amdahl!nsc!rfg at ames.arc.nasa.gov
Uucp: ...{pyramid,sun,amdahl,apple}!nsc!rfg



More information about the Comp.unix.wizards mailing list