cvs commit: src/sys/kern kern_fork.c

David Schultz das at FreeBSD.ORG
Thu Sep 30 23:32:35 PDT 2004


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.


More information about the cvs-src mailing list