not SDYING, so s/SDYING/SDEAD/.
And add the new element "dying" to the state_abbrev array.
XXX Is is correct to have two elements with the number 3 in sorted_state?
1. If fork()ing, the program is executed twice.
2. If the ktruss(1) output is bufferd, the final output is not flushed
(because it is executing).
% ktrace -f - rm >/dev/null
usage: rm [-dfiPRrW] file ...
usage: rm [-dfiPRrW] file ...
% ktruss date | cat
Fri Jul 23 12:09:45 JST 1999
Fri Jul 23 12:09:46 JST 1999
%
write lock when doing PID allocation, and during the process exit path.
Use a read lock every where else, including within schedcpu() (interrupt
context). Note that holding the write lock implies blocking schedcpu()
from running (blocks softclock).
PID allocation is now MP-safe.
Note this actually fixes a bug on single processor systems that was probably
extremely difficult to tickle; it was possible that schedcpu() would run
off a bad pointer if the right clock interrupt happened to come in the
middle of a LIST_INSERT_HEAD() or LIST_REMOVE() to/from allproc.
that not enough segments are available for the second superblock, or to have
MIN_FREE_SEGS free for work room for the cleaner, newfs_lfs will now exit
with an error.
and PID allocation MP-safe. A new process state is added: SDEAD. This
state indicates that a process is dead, but not yet a zombie (has not
yet been processed by the process reaper).
SDEAD processes exist on both the zombproc list (via p_list) and deadproc
(via p_hash; the proc has been removed from the pidhash earlier in the exit
path). When the reaper deals with a process, it changes the state to
SZOMB, so that wait4 can process it.
Add a P_ZOMBIE() macro, which treats a proc in SZOMB or SDEAD as a zombie,
and update various parts of the kernel to reflect the new state.