summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-04-17 05:26:42 +0000
committerpeter <peter@FreeBSD.org>2002-04-17 05:26:42 +0000
commit7af47267142e8d5e67c84363aba18aa64e9ef9f7 (patch)
treea0b9dfb49d13c91e13a2801d7103a7bb28b09b73 /sys
parent1642fd3abc469b91506aff081eacfe18e4a25845 (diff)
downloadFreeBSD-src-7af47267142e8d5e67c84363aba18aa64e9ef9f7.zip
FreeBSD-src-7af47267142e8d5e67c84363aba18aa64e9ef9f7.tar.gz
Do not free the vmspace until p->p_vmspace is set to null. Otherwise
statclock can access it in the tail end of statclock_process() at an unfortunate time. This bit me several times on an SMP alpha (UP2000) and the problem went away with this change. I'm not sure why it doesn't break x86 as well. Maybe it's because the clocks are much faster on alpha (HZ=1024 by default).
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 12948b1..8f8b54b 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -310,10 +310,14 @@ vmspace_free(struct vmspace *vm)
void
vmspace_exitfree(struct proc *p)
{
- GIANT_REQUIRED;
+ struct vmspace *vm;
- if (p == p->p_vmspace->vm_freer)
- vmspace_dofree(p->p_vmspace);
+ GIANT_REQUIRED;
+ if (p == p->p_vmspace->vm_freer) {
+ vm = p->p_vmspace;
+ p->p_vmspace = NULL;
+ vmspace_dofree(vm);
+ }
}
/*
OpenPOWER on IntegriCloud