Subject: Re: SMP problems in fork()?
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 12/09/2002 10:22:21
On Sun, Dec 08, 2002 at 02:12:25PM -0800, Jason R Thorpe wrote:
> On Sun, Dec 08, 2002 at 09:42:58PM +0100, Emmanuel Dreyfus wrote:
> 
>  > In fork1(), we set the child as runnable, and we use a pointer to its
>  > proc structure after this. 
>  > 
>  > On a SMP system, the child could be scheduled for running on another
>  > CPU, and it could even die before we get out of fork1(), thus making us
>  > using a stale pointer on its struct proc.
>  > 
>  > It seems to me that we need to cleanup the end of fork1(), but I'm not
>  > sure of what should be done.
> 
> You've just discovered one of the wonderful reasons why we must still run
> with a Giant Kernel Lock.

And one that can be fixed so that eventually the Giant lock can
be removed....  A slow process, but surely fixing some of the
obvious ones will help.

	David

-- 
David Laight: david@l8s.co.uk