summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-05-02 15:09:58 +0000
committerjhb <jhb@FreeBSD.org>2002-05-02 15:09:58 +0000
commit32bb95822774586d21ea60121b92cd70a07a4241 (patch)
tree7934b929065fc99d21c2f2e6d8e493090605d434 /sys/kern/kern_fork.c
parentce5fb0dc3a9dceadd1025cd914419a513a3cd2e8 (diff)
downloadFreeBSD-src-32bb95822774586d21ea60121b92cd70a07a4241.zip
FreeBSD-src-32bb95822774586d21ea60121b92cd70a07a4241.tar.gz
- Reorder a few things so that when we lock the process at the end of
exit1() we don't have to release it until we acquire schd_lock to call cpu_throw(). - Since we can switch at any time due to preemption or a lock release prior to acquiring sched_lock, don't update switchtime and switchticks until the very end of exit1() after we have acquired sched_lock. - Interlock the proctree_lock and proc lock in wait1() and exit1() to avoid lost wakeups when a parent blocks waiting for a child to exit at the bottom of wait1(). In exit1() the proc lock interlocked with proctree_lock (and released after acquiring sched_lock) is that of the parent process. - In wait1() use an exclusive lock of proctree lock while we are looking for a process to harvest. This allows us to completely remove all references to the process once we've found one (i.e., disconnect it from pgrp's, session's, zombproc list, and it's parent's children list) "atomically" without needing to worry about a lock upgrade. - We don't need sched_lock to test if p_stat is SZOMB or SSTOP when holding the proc lock since the proc lock is always held with p_stat is set to SZOMB or SSTOP. - Protect nprocs with an xlock of the allproc_lock.
Diffstat (limited to 'sys/kern/kern_fork.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud