From owner-cvs-src-old@FreeBSD.ORG Thu Mar 24 18:40:35 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57891065672 for ; Thu, 24 Mar 2011 18:40:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7704F8FC19 for ; Thu, 24 Mar 2011 18:40:35 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p2OIeZRL035046 for ; Thu, 24 Mar 2011 18:40:35 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p2OIeZ2H035044 for cvs-src-old@freebsd.org; Thu, 24 Mar 2011 18:40:35 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <201103241840.p2OIeZ2H035044@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Thu, 24 Mar 2011 18:40:11 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD 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 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 18:40:35 -0000 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