From owner-cvs-src@FreeBSD.ORG Fri Oct 1 06:32:35 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1090016A4CE; Fri, 1 Oct 2004 06:32:35 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id B87AF43D55; Fri, 1 Oct 2004 06:32:34 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i916WmYl026292; Fri, 1 Oct 2004 02:32:48 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i916WmuQ026291; Fri, 1 Oct 2004 02:32:48 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Fri, 1 Oct 2004 02:32:48 -0400 From: David Schultz To: Brian Fundakowski Feldman Message-ID: <20041001063248.GA9396@VARK.MIT.EDU> Mail-Followup-To: Brian Fundakowski Feldman , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200410010501.i9151US7086474@repoman.freebsd.org> <20041001060828.GA997@green.homeunix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041001060828.GA997@green.homeunix.org> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern kern_fork.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2004 06:32:35 -0000 On Fri, Oct 01, 2004, Brian Fundakowski Feldman wrote: > On Fri, Oct 01, 2004 at 05:01:29AM +0000, David Schultz wrote: > > das 2004-10-01 05:01:29 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/kern kern_fork.c > > Log: > > Avoid calling _PHOLD(p1) with p2's lock held, since _PHOLD() > > may block to swap in p1. Instead, call _PHOLD earlier, at a > > point where the only lock held happens to be p1's. > > Since you seem to have a handle on this: how hard do you think it > would be to make all the [_]PHOLD() consumers able to handle an > error return? It wouldn't be hard at all. Other than the files I just touched, there are only about five uses of [_]PHOLD() that differ in nontrivial ways. Another thing that needs to be done is to modify the kern_wait() path to avoid destroying processes with a nonzero hold count. In a few places (e.g. procfs), the process being held is not curproc, so it could go away.