Date: Fri, 1 Oct 2004 02:32:48 -0400 From: David Schultz <das@FreeBSD.ORG> To: Brian Fundakowski Feldman <green@FreeBSD.ORG> Cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern kern_fork.c Message-ID: <20041001063248.GA9396@VARK.MIT.EDU> In-Reply-To: <20041001060828.GA997@green.homeunix.org> References: <200410010501.i9151US7086474@repoman.freebsd.org> <20041001060828.GA997@green.homeunix.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041001063248.GA9396>