summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-04-07 07:16:06 +0000
committerpeter <peter@FreeBSD.org>1997-04-07 07:16:06 +0000
commitecf50a7463380158994f03aa71d9b084c0c5114a (patch)
treeec1548851ef256720ebb6254e235cc3d5bc04523 /sys/kern/kern_exit.c
parent237ff29ca4d094b8fbf6c41083b91ddda096ae46 (diff)
downloadFreeBSD-src-ecf50a7463380158994f03aa71d9b084c0c5114a.zip
FreeBSD-src-ecf50a7463380158994f03aa71d9b084c0c5114a.tar.gz
The biggie: Get rid of the UPAGES from the top of the per-process address
space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 2f8074c..61a93ed 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.45 1997/02/22 09:39:04 peter Exp $
+ * $Id: kern_exit.c,v 1.46 1997/03/24 11:24:35 bde Exp $
*/
#include "opt_ktrace.h"
@@ -171,8 +171,6 @@ exit1(p, rv)
/* The next two chunks should probably be moved to vmspace_exit. */
vm = p->p_vmspace;
- if (vm->vm_shm)
- shmexit(p);
/*
* Release user portion of address space.
* This releases references to vnodes,
@@ -182,6 +180,8 @@ exit1(p, rv)
* may be mapped within that space also.
*/
if (vm->vm_refcnt == 1) {
+ if (vm->vm_shm)
+ shmexit(p);
pmap_remove_pages(&vm->vm_pmap, VM_MIN_ADDRESS,
VM_MAXUSER_ADDRESS);
(void) vm_map_remove(&vm->vm_map, VM_MIN_ADDRESS,
OpenPOWER on IntegriCloud