Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jun 2011 21:48:36 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/compat/linprocfs linprocfs.c src/sys/fs/nfsclient nfs_clport.c src/sys/kern kern_descrip.c kern_fork.c kern_proc.c kern_resource.c src/sys/vm vm_meter.c vm_pageout.c
Message-ID:  <201106072149.p57Ln1tL051537@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

jhb         2011-06-07 21:48:36 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_8)
    sys/compat/linprocfs linprocfs.c 
    sys/fs/nfsclient     nfs_clport.c 
    sys/kern             kern_descrip.c kern_fork.c kern_proc.c 
                         kern_resource.c 
    sys/vm               vm_meter.c vm_pageout.c 
  Log:
  SVN rev 222839 on 2011-06-07 21:48:36Z by jhb
  
  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.
  
  Revision    Changes    Path
  1.142.2.8   +0 -2      src/sys/compat/linprocfs/linprocfs.c
  1.5.2.14    +2 -2      src/sys/fs/nfsclient/nfs_clport.c
  1.357.2.8   +4 -2      src/sys/kern/kern_descrip.c
  1.306.2.10  +5 -10     src/sys/kern/kern_fork.c
  1.285.2.17  +5 -7      src/sys/kern/kern_proc.c
  1.194.2.6   +2 -4      src/sys/kern/kern_resource.c
  1.101.2.2   +0 -3      src/sys/vm/vm_meter.c
  1.308.2.8   +4 -2      src/sys/vm/vm_pageout.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106072149.p57Ln1tL051537>