#[repr(C)]pub struct SchedInfo {Show 14 fields
pub policy: u32,
pub state: u32,
pub priority: i32,
pub flags: u32,
pub affinity_mask: u64,
pub run_time_ns: u64,
pub ticks: u64,
pub vruntime: u64,
pub rt_budget_remaining: u64,
pub rt_overruns: u64,
pub fair_wait_ticks: u64,
pub wake_deadline_ns: u64,
pub blocked_time_ns: u64,
pub ready_time_ns: u64,
}Expand description
Scheduling statistics returned by SYS_SCHED_INFO for the calling task.
policy uses the SCHED_POLICY_* values from crate::syscall, and
priority is the class-specific priority (Nice for Fair, 0..=99 for RT).
run_time_ns is sampled from the scheduler tick counter, so its
resolution is one tick (1e9 / TIMER_HZ ns).
Fields§
§policy: u32Current policy (SCHED_POLICY_*).
state: u32Task state (0 = ready, 1 = running, 2 = blocked, 3 = dead).
priority: i32Class-specific priority (sign-extended i32).
flags: u32Status flags (SCHED_INFO_FLAG_*).
affinity_mask: u64Soft CPU affinity mask (0 = no restriction).
run_time_ns: u64Total time this task has been running, in nanoseconds.
ticks: u64Total scheduler ticks charged to this task.
vruntime: u64Fair-class virtual runtime.
rt_budget_remaining: u64Remaining ticks in the current real-time budget period.
rt_overruns: u64Number of times the real-time budget was exhausted.
fair_wait_ticks: u64Ticks spent waiting in the Fair run queue without being picked.
wake_deadline_ns: u64Absolute wake deadline on the scheduler clock (0 = none armed).
blocked_time_ns: u64Total time spent in the Blocked state, in nanoseconds.
ready_time_ns: u64Derived time spent Ready-but-not-running, in nanoseconds.
Computed as now - created - run_time - blocked_time; it includes
time spent queued in a run queue and is approximate to one tick.