Files
moss-kernel/src
Matthew Leach 41dec05046 sched: implement fast-path return
Previously, the scheduler unconditionally performed a full runqueue
search:(`find_next_runnable_desc`) on every invocation, including every
timer tick and syscall return. This resulted in unnecessary overhead.

This change introduces a "lazy preemption" model:

1. Fast-Path Optimization: `do_schedule` now checks if the current task
   is valid, is not the Idle task, and still has virtual budget remaining.
   If these conditions are met and `force_resched` is not set, the
   scheduler returns immediately without locking the runqueue.

2. Preemption & Idle Handling:
   - `insert_into_runq` now sets `force_resched` if the new task has an
     earlier deadline than the current task, or if the current task is
     Idle.
   - The Idle task is explicitly excluded from the fast-path to ensure
     immediate context switching when new work arrives.
2026-01-01 22:54:43 +00:00
..
2026-01-01 22:54:43 +00:00