From a16edda365f510031db286b64ceba50e868034a4 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Mon, 28 Sep 1998 03:34:39 +0000 Subject: [PATCH] Initialize pcb_mpnest to 1 in the child process in cpu_fork(). This should fix the 50% idle problem that the ELF /sbin/init triggered. The problem appeared when the last context switch before a fork() call was due to the kernel faulting in user pages via normal page faults (e.g. copyin). Reviewed by: Peter Wemm --- sys/amd64/amd64/vm_machdep.c | 5 ++++- sys/i386/i386/vm_machdep.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 8c0b2748cdb3..fb0e60114f31 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.109 1998/08/18 07:46:58 msmith Exp $ + * $Id: vm_machdep.c,v 1.110 1998/09/25 17:34:48 peter Exp $ */ #include "npx.h" @@ -159,6 +159,9 @@ cpu_fork(p1, p2) * pcb2->pcb_onfault: cloned above (always NULL here?). */ +#ifdef SMP + pcb2->pcb_mpnest = 1; +#endif #ifdef VM86 /* * XXX don't copy the i/o pages. this should probably be fixed. diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 8c0b2748cdb3..fb0e60114f31 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.109 1998/08/18 07:46:58 msmith Exp $ + * $Id: vm_machdep.c,v 1.110 1998/09/25 17:34:48 peter Exp $ */ #include "npx.h" @@ -159,6 +159,9 @@ cpu_fork(p1, p2) * pcb2->pcb_onfault: cloned above (always NULL here?). */ +#ifdef SMP + pcb2->pcb_mpnest = 1; +#endif #ifdef VM86 /* * XXX don't copy the i/o pages. this should probably be fixed.