mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-31 14:38:21 +00:00
sched: fix bsp getting higher priority than target during bringup
This commit is contained in:
@@ -9,14 +9,14 @@ bitmap_t sched_idle_cpu_bitmap;
|
|||||||
spinlock_t sched_idle_cpu_bitmap_lock;
|
spinlock_t sched_idle_cpu_bitmap_lock;
|
||||||
|
|
||||||
static cpu_t *pick_cpu(thread_t *thread) {
|
static cpu_t *pick_cpu(thread_t *thread) {
|
||||||
// if the system is still being bootstrapped or it is a single core machine, run it on the BSP
|
|
||||||
if (arch_smp_get_cpu_count() == 1 || unlikely(arch_smp_cpusawake != arch_smp_get_cpu_count()))
|
|
||||||
return get_bsp();
|
|
||||||
|
|
||||||
// if the thread targets a specific cpu, then go into that
|
// if the thread targets a specific cpu, then go into that
|
||||||
if (thread->cputarget)
|
if (thread->cputarget)
|
||||||
return thread->cputarget;
|
return thread->cputarget;
|
||||||
|
|
||||||
|
// if the system is still being bootstrapped or it is a single core machine, run it on the BSP
|
||||||
|
if (arch_smp_get_cpu_count() == 1 || unlikely(arch_smp_cpusawake != arch_smp_get_cpu_count()))
|
||||||
|
return get_bsp();
|
||||||
|
|
||||||
// find the closest cpu in the hierarchy that the thread can run immediatelly in
|
// find the closest cpu in the hierarchy that the thread can run immediatelly in
|
||||||
cpu_t *closest = NULL;
|
cpu_t *closest = NULL;
|
||||||
if (thread->last_cpu)
|
if (thread->last_cpu)
|
||||||
|
|||||||
Reference in New Issue
Block a user