mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
scheduler: pick cpus properly in pick_cpu when system is not fully up yet
This commit is contained in:
@@ -9,9 +9,9 @@ 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 there is only one cpu awake, thats the current one
|
// if the system is still being bootstrapped or it is a single core machine, run it on the BSP
|
||||||
if (arch_smp_cpusawake == 1)
|
if (arch_smp_get_cpu_count() == 1 || unlikely(arch_smp_cpusawake != arch_smp_get_cpu_count()))
|
||||||
return current_cpu();
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user