Descriptionruntime: call rfork on scheduler stack on Plan 9
A race exists between the parent and child processes after a fork.
The child needs to access the new M pointer passed as an argument
but the parent may have already returned and clobbered it.
Previously, we avoided this by saving the necessary data into
registers before the rfork system call but this isn't guaranteed
to work because Plan 9 makes no promises about the register state
after a system call. Only the 386 kernel seems to save them.
For amd64 and arm, this method won't work.
We eliminate the race by allocating stack space for the scheduler
goroutines (g0) in the per-process copy-on-write stack segment and
by only calling rfork on the scheduler stack.
   
  Patch Set 1 #Patch Set 2 : diff -r 66c3664bd245 https://code.google.com/p/go #Patch Set 3 : diff -r 66c3664bd245 https://code.google.com/p/go #Patch Set 4 : diff -r 66c3664bd245 https://code.google.com/p/go #Patch Set 5 : diff -r 66c3664bd245 https://code.google.com/p/go #
      Total comments: 5
      
     
  
  
  
  Patch Set 6 : diff -r 66c3664bd245 https://code.google.com/p/go #
      Total comments: 1
      
     
  
  
  
  Patch Set 7 : diff -r d5c083552430 https://code.google.com/p/go #Patch Set 8 : diff -r 1b4900565b48d0f03f4f5263116b688fbeed75f8 https://code.google.com/p/go #Patch Set 9 : diff -r 473a2c28eb342eae133c6b91b9511afeeba04c9e https://code.google.com/p/go #
      Total comments: 2
      
     
  
  
  
  Patch Set 10 : diff -r 428dd5a62a9dad3f037c45aaf19ffecca8801b7e https://code.google.com/p/go #Patch Set 11 : diff -r 1ad196212ec464e41a35c4bd5553bf302e8e887b https://code.google.com/p/go #Patch Set 12 : diff -r 0eda065231ddc227a5f7ac9bb2aeed9259f8966f https://code.google.com/p/go #
 MessagesTotal messages: 23 
  
       | 
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||