scheduler_affine: Correctly assign CPUs to idle threads

This commit is contained in:
Pawel Dziepak 2013-10-21 02:20:09 +02:00
parent cd8d4e39fd
commit 84812e6033
2 changed files with 3 additions and 3 deletions

View File

@ -614,9 +614,8 @@ affine_enqueue(Thread* thread, bool newOne)
targetCore = sCPUToCore[targetCPU];
ASSERT(targetCore == schedulerThreadData->previous_core);
} else if (schedulerThreadData->previous_core < 0) {
if (thread->priority == B_IDLE_PRIORITY) {
static int32 idleThreads = 0;
targetCPU = idleThreads++;
if (thread_is_idle_thread(thread)) {
targetCPU = thread->previous_cpu->cpu_num;
targetCore = sCPUToCore[targetCPU];
} else {
targetCore = affine_choose_core();

View File

@ -2720,6 +2720,7 @@ thread_init(kernel_args *args)
}
gCPU[i].running_thread = thread;
thread->previous_cpu = &gCPU[i];
thread->team = team_get_kernel_team();
thread->priority = B_IDLE_PRIORITY;