scheduler_affine: Correctly assign CPUs to idle threads
This commit is contained in:
parent
cd8d4e39fd
commit
84812e6033
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user