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.
This commit is contained in:
parent
31c4f57542
commit
91c1172a5a
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user