Subject: Re: tsleep() in vfs_shutdown (update)
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-kern
Date: 08/28/2000 08:12:45
> > When is a process with P_HOLD set going to call fork1()?
>
> fork1() is:
> int fork1(struct proc *p1, int flags, int exitsig, void *stack,
> size_t stacksize, void (*func)(void *), void *arg, register_t *retval,
> struct proc **rnewprocp)
>
> So fork1() can be called with p1 != curproc (p1 may be suspended, but
> not curproc). Now, in the current code nothing may do this, but I can't see
> any reason to dissalow it (otherwise change the interface to remove p1 and
> always use curproc).
This logic is fallacious. Syscall functions take a proc "p" as their
third argument; however, they're not necessarily going to work
correctly if p != curproc. On smp systems, evaluating "curproc" may
be expensive; bsd4.4 started passing curproc around explicitly in the
in-kernel interfaces. This is no different.
- Bill