The same CPU is assigned to a different process.

refs #423
This commit is contained in:
Tomoki Shirasawa
2015-02-17 18:27:46 +09:00
parent dbe4ec3247
commit 9574a28a5f

View File

@ -2041,8 +2041,19 @@ redo:
/* No process? Run idle.. */
if (!next) {
next = &cpu_local_var(idle);
v->status = CPU_STATUS_IDLE;
list_for_each_entry_safe(proc, tmp, &(v->runq), sched_list) {
if (proc->ftn->status & (PS_INTERRUPTIBLE |
PS_UNINTERRUPTIBLE |
PS_STOPPED |
PS_TRACED)) {
next = proc;
break;
}
}
if (!next) {
next = &cpu_local_var(idle);
v->status = CPU_STATUS_IDLE;
}
}
}