diff options
author | peter <peter@FreeBSD.org> | 2004-08-28 00:49:22 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-08-28 00:49:22 +0000 |
commit | 587d1d74f30e955065db313171901efe9d6cafec (patch) | |
tree | d6e56573c8d95164b2b0aa52837597204c753850 | |
parent | 108263c666c3559c3e28fa4d48086f31f05249be (diff) | |
download | FreeBSD-src-587d1d74f30e955065db313171901efe9d6cafec.zip FreeBSD-src-587d1d74f30e955065db313171901efe9d6cafec.tar.gz |
Commit Jeff's suggested changes for avoiding a bug that is exposed by
preemption and/or the rev 1.79 kern_switch.c change that was backed out.
The thread was being assigned to a runq without adding in the load, which
would cause the counter to hit -1.
-rw-r--r-- | sys/kern/sched_ule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index b2b9861..0e88c7b 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1197,11 +1197,9 @@ sched_switch(struct thread *td, struct thread *newtd) kse_reassign(ke); } } - if (newtd != NULL) { + if (newtd != NULL) kseq_load_add(KSEQ_SELF(), newtd->td_kse); - ke->ke_cpu = PCPU_GET(cpuid); - ke->ke_runq = KSEQ_SELF()->ksq_curr; - } else + else newtd = choosethread(); if (td != newtd) cpu_switch(td, newtd); |