set_timer(): treat spin wait as PS_RUNNING

Change-Id: Iea1ad5b0a49a12d5e1aef38ad68fccb8d789af5e
This commit is contained in:
Balazs Gerofi
2019-09-26 12:21:00 +09:00
committed by Masamichi Takagi
parent 2b9a053504
commit 17a8f68d60

View File

@ -3328,7 +3328,7 @@ void set_timer(int runq_locked)
}
list_for_each_entry(thread, &v->runq, sched_list) {
if (thread->status != PS_RUNNING) {
if (thread->status != PS_RUNNING && !thread->spin_sleep) {
continue;
}
num_running++;
@ -3338,7 +3338,7 @@ void set_timer(int runq_locked)
if (num_running > 1 || v->current->itimer_enabled ||
!list_empty(&v->backlog_list)) {
if (!cpu_local_var(timer_enabled)) {
lapic_timer_enable(/*10000000*/1000000);
lapic_timer_enable(1000000);
cpu_local_var(timer_enabled) = 1;
}
}