aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2005-08-19 13:35:34 +0000
committerDavid Xu <davidxu@FreeBSD.org>2005-08-19 13:35:34 +0000
commit8c6d7a8db81cd4d0171689626f909acbb59c1710 (patch)
tree07ff9efc7df0cd2edc792f5410cc9e1fa89023dd /sys/kern/kern_kse.c
parent8ddda5248576ce82727ad7adf71d3de92b0325aa (diff)
downloadsrc-8c6d7a8db81cd4d0171689626f909acbb59c1710.tar.gz
src-8c6d7a8db81cd4d0171689626f909acbb59c1710.zip
Fix a LOR between sched_lock and sleep queue lock.
Notes
Notes: svn path=/head/; revision=149284
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 5f493137e4a6..827fb66dd1ba 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -707,8 +707,8 @@ kse_create(struct thread *td, struct kse_create_args *uap)
* Make the new upcall available to the ksegrp.
* It may or may not use it, but it's available.
*/
- PROC_UNLOCK(p);
upcall_link(newku, newkg);
+ PROC_UNLOCK(p);
if (mbx.km_quantum)
newkg->kg_upquantum = max(1, mbx.km_quantum / tick);
@@ -1441,7 +1441,7 @@ thread_continued(struct proc *p)
struct thread *td;
PROC_LOCK_ASSERT(p, MA_OWNED);
- mtx_assert(&sched_lock, MA_OWNED);
+ KASSERT(P_SHOULDSTOP(p), "process not stopped");
if (!(p->p_flag & P_SA))
return;
@@ -1455,11 +1455,10 @@ thread_continued(struct proc *p)
if (!(td->td_pflags & TDP_SA))
continue;
FOREACH_UPCALL_IN_GROUP(kg, ku) {
+ mtx_lock_spin(&sched_lock);
ku->ku_flags |= KUF_DOUPCALL;
+ mtx_unlock_spin(&sched_lock);
wakeup(&kg->kg_completed);
- if (TD_IS_SUSPENDED(ku->ku_owner)) {
- thread_unsuspend_one(ku->ku_owner);
- }
}
}
}