Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2011 18:40:11 +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 kern_thread.c src/sys/vm vm_meter.c vm_pageout.c
Message-ID:  <201103241840.p2OIeZ2H035044@repoman.freebsd.org>

index | next in thread | raw e-mail

jhb         2011-03-24 18:40:11 UTC

  FreeBSD src repository

  Modified files:
    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 kern_thread.c 
    sys/vm               vm_meter.c vm_pageout.c 
  Log:
  SVN rev 219968 on 2011-03-24 18:40:11Z by jhb
  
  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.
  - Reorder fill_kinfo_proc() slightly so it only acquires PROC_SLOCK() once.
  
  MFC after:      1 week
  
  Revision  Changes    Path
  1.158     +0 -2      src/sys/compat/linprocfs/linprocfs.c
  1.14      +2 -2      src/sys/fs/nfsclient/nfs_clport.c
  1.364     +4 -2      src/sys/kern/kern_descrip.c
  1.325     +4 -7      src/sys/kern/kern_fork.c
  1.312     +6 -10     src/sys/kern/kern_proc.c
  1.207     +2 -4      src/sys/kern/kern_resource.c
  1.302     +2 -2      src/sys/kern/kern_thread.c
  1.104     +0 -3      src/sys/vm/vm_meter.c
  1.335     +4 -6      src/sys/vm/vm_pageout.c


help

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