fix: sched round-robin, cap slot OOB panic, clippy, make ci

- RunList -> intrusive FIFO, no starvation, no silent drop
- cap table sized to CapSlot range (kani caught OOB panic)
- snake food color test uses const
- kani cfg lint, RUST_MIN_STACK for big kernel struct in tests
This commit is contained in:
2026-10-26 19:08:30 +01:00
parent 1c04ddf909
commit e931485ca7
32 changed files with 384 additions and 251 deletions

View File

@@ -47,13 +47,13 @@ impl MultiCoreScheduler {
fn least_loaded_core(&self) -> Option<CoreId> {
(0..self.num_cores)
.map(|i| CoreId::from_raw(i))
.map(CoreId::from_raw)
.min_by_key(|&c| self.thread_count_on(c))
}
fn most_loaded_core(&self) -> Option<CoreId> {
(0..self.num_cores)
.map(|i| CoreId::from_raw(i))
.map(CoreId::from_raw)
.max_by_key(|&c| self.thread_count_on(c))
}
}
@@ -69,7 +69,7 @@ impl Scheduler for MultiCoreScheduler {
let idx = thread.raw() as usize;
if let Some(placement) = self.placements[idx].take() {
let core_idx = placement.core.raw() as usize;
self.cores[core_idx].remove(thread, placement.priority);
self.cores[core_idx].remove(thread);
if self.cores[core_idx].current() == Some(thread) {
self.cores[core_idx].clear_current();
}
@@ -85,13 +85,12 @@ impl Scheduler for MultiCoreScheduler {
if let Some(placement) = &self.placements[idx] {
let current_priority = placement.priority;
let core_idx = core.raw() as usize;
if let Some(highest) = self.cores[core_idx].highest_waiting_priority() {
if highest > current_priority {
if let Some(next) = self.cores[core_idx].pick_next() {
self.cores[core_idx].add(current, current_priority);
return SchedulerDecision::Preempt(next);
}
}
if let Some(highest) = self.cores[core_idx].highest_waiting_priority()
&& highest > current_priority
&& let Some(next) = self.cores[core_idx].pick_next()
{
self.cores[core_idx].add(current, current_priority);
return SchedulerDecision::Preempt(next);
}
}
SchedulerDecision::Continue