Expand description
Process and thread scheduling module
Implements a multi-level scheduler with support for:
- Multiple scheduling algorithms (round-robin, priority, CFS)
- Real-time scheduling classes
- SMP load balancing
- CPU affinity
- Context switching for x86_64, AArch64, and RISC-V
This module is a facade that re-exports the public API from submodules:
scheduler- Core scheduler algorithm and statetask- Task control block and priority typesmetrics- Performance metrics and measurementsmp- Symmetric multiprocessing supportqueue- Ready queue managementnuma- NUMA-aware scheduling- [
init] - Initialization and timer setup runtime- Scheduler execution loop and idle taskprocess_compat- Process compatibility wrapper typesipc_blocking- IPC blocking/waking and wait queuestask_management- Task creation, exit, and thread schedulingload_balance- Load balancing and task migration
Re-exports§
pub use scheduler::SchedAlgorithm;pub use init::init;pub use init::init_with_bootstrap;pub use ipc_blocking::block_on_ipc;pub use ipc_blocking::block_process;pub use ipc_blocking::wake_up_endpoint_waiters;pub use ipc_blocking::wake_up_process;pub use ipc_blocking::yield_cpu;pub use load_balance::balance_load;pub use load_balance::cleanup_dead_tasks;pub use process_compat::alloc_pid;pub use process_compat::current_process;pub use process_compat::find_process;pub use process_compat::switch_to_process;pub use process_compat::TaskProcessAdapter;pub use runtime::has_ready_tasks;pub use runtime::idle_task_entry;pub use runtime::run;pub use runtime::set_algorithm;pub use runtime::start;pub use runtime::timer_tick;pub use task::Priority;pub use task::SchedClass;pub use task::SchedPolicy;pub use task::Task;pub use task_management::exit_task;pub use task_management::create_task;pub use task_management::create_task_from_thread;pub use task_management::schedule_thread;pub use self::scheduler::should_preempt;
Modules§
- deadline
- Earliest Deadline First (EDF) Deadline Scheduler
- init
- Scheduler initialization and timer setup
- ipc_
blocking - IPC blocking and waking operations
- load_
balance - Load balancing and task migration between CPUs
- metrics
- Scheduler performance metrics and measurement
- numa
- NUMA-Aware Scheduling
- percpu_
queue - Per-CPU Ready Queues with Work-Stealing
- process_
compat - Process compatibility wrapper types
- queue
- Ready queue management for scheduler
- runtime
- Scheduler runtime loop and idle task management
- scheduler
- Core scheduler implementation
- smp
- Symmetric multiprocessing (SMP) support
- task
- Task management and task control block (TCB) implementation
- task_
management - Task creation, exit, and thread scheduling
- task_
ptr - Safe wrapper for task pointers
Functions§
- current_
process_ id - Get the PID of the currently running task.
- get_
current_ thread_ id - Get the current thread ID from the running task.
- set_
current_ ⚠task - Set current task (for testing)
Type Aliases§
- Process
- Type alias for backward compatibility.