summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-10-29 01:32:17 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-10-29 01:32:17 +0000
commit0cd9410d50b72c06b8656b100a11c3e26c504122 (patch)
treea6f8e6a9c04f082e509201e19ada456cbc733412
parent1b1ed59c8e3e3e00c7172ff67e882aad84ecf648 (diff)
No need to free the address space in exit1(), we'll do that in the reaper.
That gives us the advantage of not being the active address space when freeing the mappings in the pmap, which can lead to expensive TLB flushes on some architectures. plus some minor cleaning.
-rw-r--r--sys/kern/kern_exit.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 7fc0f5c5176..73106d679da 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.42 2002/05/16 16:16:51 provos Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.43 2002/10/29 01:32:16 art Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -81,8 +81,6 @@
#include <uvm/uvm_extern.h>
-void proc_zap(struct proc *);
-
/*
* exit --
* Death of process.
@@ -113,7 +111,6 @@ exit1(p, rv)
int rv;
{
struct proc *q, *nq;
- struct vmspace *vm;
if (p->p_pid == 1)
panic("init died (signal %d, exit %d)",
@@ -142,23 +139,9 @@ exit1(p, rv)
*/
fdfree(p);
- /* The next three chunks should probably be moved to vmspace_exit. */
- vm = p->p_vmspace;
#ifdef SYSVSEM
semexit(p);
#endif
- /*
- * Release user portion of address space.
- * This releases references to vnodes,
- * which could cause I/O if the file has been unlinked.
- * Need to do this early enough that we can still sleep.
- * Can't free the entire vmspace as the kernel stack
- * may be mapped within that space also.
- */
- if (vm->vm_refcnt == 1)
- (void) uvm_deallocate(&vm->vm_map, VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS);
-
if (SESS_LEADER(p)) {
register struct session *sp = p->p_session;
@@ -347,7 +330,7 @@ exit2(p)
* a zombie, and the parent is allowed to read the undead's status.
*/
void
-reaper()
+reaper(void)
{
struct proc *p;
@@ -519,10 +502,8 @@ proc_reparent(child, parent)
}
void
-proc_zap(p)
- struct proc *p;
+proc_zap(struct proc *p)
{
-
pool_put(&rusage_pool, p->p_ru);
/*