]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC 219968:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 7 Jun 2011 21:48:36 +0000 (21:48 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 7 Jun 2011 21:48:36 +0000 (21:48 +0000)
commit106760a05c9d701385fc7f75b7064236cf94842c
tree1f151b2282a6d300777704fa5241a0419a798730
parent735a777ffa40f80064d110edaf4507b2a95fc75a
MFC 219968:
Fix some locking nits with the p_state field of struct proc:
- Hold the proc lock while changing the state from PRS_NEW to PRS_NORMAL
  in fork to honor the locking requirements.  While here, expand the scope
  of the PROC_LOCK() on the new process (p2) to avoid some LORs.  Previously
  the code was locking the new child process (p2) after it had locked the
  parent process (p1).  However, when locking two processes, the safe order
  is to lock the child first, then the parent.
- Fix various places that were checking p_state against PRS_NEW without
  having the process locked to use PROC_LOCK().  Every place was already
  locking the process, just after the PRS_NEW check.
- Remove or reduce the use of PROC_SLOCK() for places that were checking
  p_state against PRS_NEW.  The PROC_LOCK() alone is sufficient for reading
  the current state.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/compat/linprocfs/linprocfs.c
sys/fs/nfsclient/nfs_clport.c
sys/kern/kern_descrip.c
sys/kern/kern_fork.c
sys/kern/kern_proc.c
sys/kern/kern_resource.c
sys/vm/vm_meter.c
sys/vm/vm_pageout.c