From owner-cvs-src-old@FreeBSD.ORG Tue Jun 7 21:49:01 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 E0BCE1065670 for ; Tue, 7 Jun 2011 21:49:01 +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 B46BC8FC08 for ; Tue, 7 Jun 2011 21:49:01 +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 p57Ln11X051538 for ; Tue, 7 Jun 2011 21:49:01 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p57Ln1tL051537 for cvs-src-old@freebsd.org; Tue, 7 Jun 2011 21:49:01 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <201106072149.p57Ln1tL051537@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Tue, 7 Jun 2011 21:48:36 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 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 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: Tue, 07 Jun 2011 21:49:02 -0000 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