diff options
author | 2009-10-05 17:43:07 +0000 | |
---|---|---|
committer | 2009-10-05 17:43:07 +0000 | |
commit | 475bef4440fd5c44414e61daed6d4f75c93df3ed (patch) | |
tree | f28140c832e1f0f48e7cbb3a76a5813469628188 /sys/kern/kern_sched.c | |
parent | regen (diff) | |
download | wireguard-openbsd-475bef4440fd5c44414e61daed6d4f75c93df3ed.tar.xz wireguard-openbsd-475bef4440fd5c44414e61daed6d4f75c93df3ed.zip |
Don't drop the big lock at the end of exit1(), but move it into the middle of
sched_exit(). This means that cpu_exit() and whatever it does (for instance
calling free(), as well as the deadproc p_hash handling are now locked as well.
This may have been one of the causes of the reaper panics, especially with
rthread patches... which were terminating a lot of threads very quickly onto
the deadproc p_hash list.
ok kurt kettenis miod
Diffstat (limited to 'sys/kern/kern_sched.c')
-rw-r--r-- | sys/kern/kern_sched.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 08694052d08..15d57cf037c 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.13 2009/04/22 08:35:54 art Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.14 2009/10/05 17:43:08 deraadt Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org> * @@ -180,9 +180,8 @@ sched_exit(struct proc *p) LIST_INSERT_HEAD(&spc->spc_deadproc, p, p_hash); -#ifdef MULTIPROCESSOR - KASSERT(__mp_lock_held(&kernel_lock) == 0); -#endif + /* This process no longer needs to hold the kernel lock. */ + KERNEL_PROC_UNLOCK(p); SCHED_LOCK(s); idle = spc->spc_idleproc; |