From 058bfddd5840db1c9dd75c3d25a63f60902e1578 Mon Sep 17 00:00:00 2001 From: Mark Poliakov Date: Tue, 18 Jul 2023 19:22:30 +0300 Subject: [PATCH] sched: Fix kernel panic (1 -> idle, idle -> idle) --- src/task/sched.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/task/sched.rs b/src/task/sched.rs index 0c498cc1..cd6e5f91 100644 --- a/src/task/sched.rs +++ b/src/task/sched.rs @@ -115,20 +115,7 @@ impl CpuQueue { // Start from idle thread to avoid having a Rc stuck here without getting dropped let t = CNTPCT_EL0.get(); self.lock().stats.measure_time = t; - - let mut inner = self.inner.lock(); - if let Some(proc) = inner.next_ready_task() { - inner.queue.push_back(proc.clone()); - inner.current = Some(proc.clone()); - proc.set_running(Cpu::local_id()); - - drop(inner); - proc.context().enter(); - } else { - drop(inner); - - self.idle.enter(); - }; + self.idle.enter() } /// Yields CPU execution to the next task in queue (or idle task if there aren't any). @@ -177,6 +164,7 @@ impl CpuQueue { (&self.idle, 0) }; + // log_print_raw!(crate::debug::LogLevel::Info, "{}: ", Cpu::local_id()); // if let Some(from) = current.as_ref() { // log_print_raw!(crate::debug::LogLevel::Info, "{}", from.id()); // } else {