Skip to main content

SchedInfo

Struct SchedInfo 

Source
#[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: u32

Current policy (SCHED_POLICY_*).

§state: u32

Task state (0 = ready, 1 = running, 2 = blocked, 3 = dead).

§priority: i32

Class-specific priority (sign-extended i32).

§flags: u32

Status flags (SCHED_INFO_FLAG_*).

§affinity_mask: u64

Soft CPU affinity mask (0 = no restriction).

§run_time_ns: u64

Total time this task has been running, in nanoseconds.

§ticks: u64

Total scheduler ticks charged to this task.

§vruntime: u64

Fair-class virtual runtime.

§rt_budget_remaining: u64

Remaining ticks in the current real-time budget period.

§rt_overruns: u64

Number of times the real-time budget was exhausted.

§fair_wait_ticks: u64

Ticks spent waiting in the Fair run queue without being picked.

§wake_deadline_ns: u64

Absolute wake deadline on the scheduler clock (0 = none armed).

§blocked_time_ns: u64

Total time spent in the Blocked state, in nanoseconds.

§ready_time_ns: u64

Derived 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.

Trait Implementations§

Source§

impl Clone for SchedInfo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SchedInfo

Source§

impl Debug for SchedInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SchedInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.