From 1f4660d407274bda524eebb9722b3d2112a6eeaf Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 7 Sep 2025 00:06:26 -0300 Subject: [PATCH] scheduler: if load balancer is run before smp is up, return --- kernel-src/sys/scheduler/queue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel-src/sys/scheduler/queue.c b/kernel-src/sys/scheduler/queue.c index 0145b0c6..79027c43 100644 --- a/kernel-src/sys/scheduler/queue.c +++ b/kernel-src/sys/scheduler/queue.c @@ -295,6 +295,9 @@ void sched_calendar_tick(context_t *, dpcarg_t) { // note that there has to be a migrateable thread for this to be possible. // (so if a thread targets the cpu it is ignored in the count) void sched_load_balancer(context_t *, dpcarg_t) { + if (!smp_cpus) + return; + interrupt_set(false); cpu_t *most_loaded = NULL; cpu_t *least_loaded = NULL;