summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-01-15 18:58:42 +0000
committerbde <bde@FreeBSD.org>1997-01-15 18:58:42 +0000
commitcfb07f1e1be1867dd238112b16159442dea3b60b (patch)
treefb7cf6583593b809db8920a1118ec243efdba3b0
parentb1f2400fbcb1d2e8a1662f0e4871f191fcbe8c43 (diff)
downloadFreeBSD-src-cfb07f1e1be1867dd238112b16159442dea3b60b.zip
FreeBSD-src-cfb07f1e1be1867dd238112b16159442dea3b60b.tar.gz
Fixed interrupt unmasking for child processes which I broke in
rev.1.10 two years ago. Children continued to run at splhigh() after returning from vm_fork(). This mainly affected kernel processes and init. For ordinary processes, interrupts are normally unmasked a few instructions later after fork() returns (it may be important for syscall() not to reschedule the child processes). Kernel processes had workarounds for the problem. Init manages to start because some routines "know" that it is safe to go to sleep despite their caller starting them at a high ipl. Then its ipl gets fixed on its first normal return from a syscall.
-rw-r--r--sys/kern/kern_fork.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 48d5849..572cb60 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -343,6 +343,7 @@ again:
* Child process. Set start time and get to work.
*/
microtime(&runtime);
+ (void) spl0();
p2->p_stats->p_start = runtime;
p2->p_acflag = AFORK;
return (0);
OpenPOWER on IntegriCloud