summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2005-08-03 01:23:45 +0000
committerdavidxu <davidxu@FreeBSD.org>2005-08-03 01:23:45 +0000
commit69017b27e9c7eff3ef680bc13b84263d1bc75e92 (patch)
tree8e35a172cd118787060f8ebb8bac0c9231ccb305 /sys
parentc0c21f6ca7154b0b731af2fc4e975405e5dd130c (diff)
downloadFreeBSD-src-69017b27e9c7eff3ef680bc13b84263d1bc75e92.zip
FreeBSD-src-69017b27e9c7eff3ef680bc13b84263d1bc75e92.tar.gz
In adjustrunqueue(), add code to handle thread migrating case for
ULE scheduler. In original code, local run queue of threaded ksegrp is corrupted if adjustrunqueue() is called while thread is migrating.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_switch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index 498d98c..b5c8130 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -312,7 +312,12 @@ adjustrunqueue( struct thread *td, int newpri)
/* It is a threaded process */
kg = td->td_ksegrp;
- if (ke->ke_state == KES_ONRUNQ) {
+ if (ke->ke_state == KES_ONRUNQ
+#ifdef SCHED_ULE
+ || ((ke->ke_flags & KEF_ASSIGNED) != 0 &&
+ (ke->ke_flags & KEF_REMOVED) == 0)
+#endif
+ ) {
if (kg->kg_last_assigned == td) {
kg->kg_last_assigned =
TAILQ_PREV(td, threadqueue, td_runq);
OpenPOWER on IntegriCloud