Expand description
Scheduling syscalls (SYS_SCHED_*, block 345-349).
Before this module, a userspace task could not change its policy, its
priority or its CPU affinity: all three were fixed at creation from the
silo configuration. The kernel already implements every scheduling class
(SchedPolicy), so this is an exposure layer, not a scheduler rewrite.
Scope is deliberately limited to the calling task. Becoming real-time is gated on silo-admin capability until a dedicated scheduling capability resource exists (tracked as security work R11); dropping to Fair/Idle is always allowed so a task can never trap itself in an unschedulable state.
Re-exportsΒ§
use super::error::SyscallError;πuse crate::memory::UserSliceWrite;πuse crate::process::current_task_clone;πuse crate::process::sched::nice::Nice;πuse crate::process::sched::real_time::RealTimePriority;πuse crate::process::sched::SchedPolicy;πuse crate::process::set_task_sched_policy;πuse crate::process::Task;πuse crate::process::TaskPriority;πuse strat9_abi::data::SchedInfo;πuse strat9_abi::data::SCHED_INFO_FLAG_RT_DEGRADED;πuse strat9_abi::syscall::SCHED_POLICY_FAIR;πuse strat9_abi::syscall::SCHED_POLICY_FIFO;πuse strat9_abi::syscall::SCHED_POLICY_IDLE;πuse strat9_abi::syscall::SCHED_POLICY_RR;π
FunctionsΒ§
- decode_
policy π - Decode an ABI policy/priority pair into a kernel
SchedPolicy. - encode_
policy π - Encode a kernel
SchedPolicyback into the(policy, priority)wire representation used bySYS_SCHED_GET. - exceeds_
priority_ πceiling - Whether
newgives more CPU entitlement than the task was created with. - online_
cpu_ πmask - The mask of CPUs currently online, as a 64-bit affinity mask.
- sys_
sched_ get SYS_SCHED_GET(346): read the calling taskβs policy and priority.- sys_
sched_ getaffinity SYS_SCHED_GETAFFINITY(348): read the calling taskβs soft CPU mask.- sys_
sched_ info SYS_SCHED_INFO(349): fill aSchedInfofor the calling task.- sys_
sched_ set SYS_SCHED_SET(345): change the calling taskβs policy and priority.- sys_
sched_ setaffinity SYS_SCHED_SETAFFINITY(347): replace the calling taskβs soft CPU mask.