summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-12-14 02:06:29 +0000
committerjeff <jeff@FreeBSD.org>2003-12-14 02:06:29 +0000
commitfe983d426042f04e5140b9bf4b5278500a50a1df (patch)
tree2c9deb31140cdddfd6c74d95e817e8a0e203ec2b
parent6b2a4c99ba61541703526fbc3550dfc0f0540ce3 (diff)
downloadFreeBSD-src-fe983d426042f04e5140b9bf4b5278500a50a1df.zip
FreeBSD-src-fe983d426042f04e5140b9bf4b5278500a50a1df.tar.gz
- Assign the ke_cpu field in kseq_notify() so that all of our callers do not
have to do it. - Set the ke_runq to NULL in sched_add() before calling kseq_notify(). Otherwise we may panic in sched_add() if INVARIANTS is on.
-rw-r--r--sys/kern/sched_ule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 4d5d460..aeb0094 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -591,8 +591,6 @@ kseq_move(struct kseq *from, int cpu)
ke->ke_state = KES_THREAD;
kseq_runq_rem(kseq, ke);
kseq_load_rem(kseq, ke);
-
- ke->ke_cpu = cpu;
kseq_notify(ke, cpu);
}
@@ -658,6 +656,7 @@ kseq_notify(struct kse *ke, int cpu)
struct thread *td;
struct pcpu *pcpu;
+ ke->ke_cpu = cpu;
ke->ke_flags |= KEF_ASSIGNED;
kseq = KSEQ_CPU(cpu);
@@ -761,7 +760,6 @@ kseq_transfer(struct kseq *kseq, struct kse *ke, int class)
*/
if (cpu) {
cpu--;
- ke->ke_cpu = cpu;
ke->ke_runq = NULL;
kseq_notify(ke, cpu);
return (1);
@@ -1584,6 +1582,7 @@ sched_add(struct thread *td)
}
#ifdef SMP
if (ke->ke_cpu != PCPU_GET(cpuid)) {
+ ke->ke_runq = NULL;
kseq_notify(ke, ke->ke_cpu);
return;
}
@@ -1696,7 +1695,6 @@ sched_bind(struct thread *td, int cpu)
ke->ke_state = KES_THREAD;
ke->ke_ksegrp->kg_runq_kses--;
kseq_load_rem(KSEQ_CPU(ke->ke_cpu), ke);
- ke->ke_cpu = cpu;
kseq_notify(ke, cpu);
/* When we return from mi_switch we'll be on the correct cpu. */
td->td_proc->p_stats->p_ru.ru_nvcsw++;
OpenPOWER on IntegriCloud