Subject: fork1(), uvm_fork() and cpu_fork()
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 11/29/2002 15:55:38
At the momemt fork1() calls uvm_form() which then calls cpu_fork().
ISTM that it would be better for fork1() to call cpu_fork() after
uvm_fork() returns.
This would enable process setup that required access to the user
area to be put into (the more logical) fork1() routine, instead
of having to hide it in uvm_fork().
At the moment the only such code is that which sets up the p->p_stats
area. However I have just made a kernel which puts p->p_sigacts
into the user area [1]. This requires sigactsinit() to be called
after the child's user area has been locked down.
I've also noticed the PHOLD(p1) and PRELE(p1) in fork1().
Surely p1 is the active process so cannot be swapped?
What must be necessary is to stop p2 (the child) being swapped?
Comments?
David
[1] unless it is shared, when it is allocated from the pool.
--
David Laight: david@l8s.co.uk