summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-10-29 01:32:16 +0000
committerart <art@openbsd.org>2002-10-29 01:32:16 +0000
commit0f3191790e8ff706efcf4b269b0911fe4dcebb3c (patch)
tree4f9c0c489e427575d857b6b495a818a34c08fbe0
parent"len = entry->end - entry->start;" then logically "entry->start + len" (diff)
downloadwireguard-openbsd-0f3191790e8ff706efcf4b269b0911fe4dcebb3c.tar.xz
wireguard-openbsd-0f3191790e8ff706efcf4b269b0911fe4dcebb3c.zip
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);
/*