Struct sched_attr_t
#[repr(C)]pub struct sched_attr_t {
pub size: u32,
pub sched_policy: u32,
pub sched_flags: u64,
pub sched_nice: i32,
pub sched_priority: u32,
pub sched_runtime: u64,
pub sched_deadline: u64,
pub sched_period: u64,
pub sched_util_min: u32,
pub sched_util_max: u32,
}
dep_nc
only.Expand description
Extended scheduling parameters data structure.
This is needed because the original struct sched_param
can not be
altered without introducing ABI issues with legacy applications
(e.g., in sched_getparam()
).
However, the possibility of specifying more than just a priority for the tasks may be useful for a wide variety of application fields, e.g., multimedia, streaming, automation and control, and many others.
This variant (sched_attr
) allows to define additional attributes to
improve the scheduler knowledge about task requirements.
§Scheduling Class Attributes
A subset of sched_attr
attributes specifies the
scheduling policy and relative POSIX attributes:
@size size of the structure, for fwd/bwd compat.
@sched_policy
task’s scheduling policy
@sched_nice
task’s nice value (SCHED_NORMAL/BATCH
)
@sched_priority
task’s static priority (SCHED_FIFO/RR
)
Certain more advanced scheduling features can be controlled by a predefined set of flags via the attribute:
@sched_flags
for customizing the scheduler behaviour
§Sporadic Time-Constrained Task Attributes
A subset of sched_attr
attributes allows to describe a so-called
sporadic time-constrained task.
In such a model a task is specified by:
- the activation period or minimum instance inter-arrival time;
- the maximum (or average, depending on the actual scheduling discipline) computation time of all instances, a.k.a. runtime;
- the deadline (relative to the actual activation time) of each instance.
Very briefly, a periodic (sporadic) task asks for the execution of some specific computation –which is typically called an instance– (at most) every period. Moreover, each instance typically lasts no more than the runtime and must be completed by time instant t equal to the instance activation time + the deadline.
This is reflected by the following fields of the sched_attr
structure:
@sched_deadline
representative of the task’s deadline
@sched_runtime
representative of the task’s runtime
@sched_period
representative of the task’s period
Given this task model, there are a multiplicity of scheduling algorithms and policies, that can be used to ensure all the tasks will make their timing constraints.
As of now, the SCHED_DEADLINE
policy (sched_dl
scheduling class) is the
only user of this new interface. More information about the algorithm
available in the scheduling class file or in Documentation/.
§Task Utilization Attributes
A subset of sched_attr
attributes allows to specify the utilization
expected for a task. These attributes allow to inform the scheduler about
the utilization boundaries within which it should schedule the task. These
boundaries are valuable hints to support scheduler decisions on both task
placement and frequency selection.
@sched_util_min
represents the minimum utilization
@sched_util_max
represents the maximum utilization
Utilization is a value in the range [0..SCHED_CAPACITY_SCALE]
. It
represents the percentage of CPU time used by a task when running at the
maximum frequency on the highest capacity CPU of the system. For example, a
20% utilization task is a task running for 2ms every 10ms at maximum
frequency.
A task with a min utilization value bigger than 0 is more likely scheduled on a CPU with a capacity big enough to fit the specified value. A task with a max utilization value smaller than 1024 is more likely scheduled on a CPU with no more capacity than the specified value.
Fields§
§size: u32
§sched_policy: u32
§sched_flags: u64
§sched_nice: i32
SCHED_NORMAL
, SCHED_BATCH
sched_priority: u32
SCHED_FIFO
, SCHED_RR
sched_runtime: u64
SCHED_DEADLINE
sched_deadline: u64
§sched_period: u64
§sched_util_min: u32
Utilization hints
sched_util_max: u32
Trait Implementations§
§impl Clone for sched_attr_t
impl Clone for sched_attr_t
§fn clone(&self) -> sched_attr_t
fn clone(&self) -> sched_attr_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for sched_attr_t
impl Debug for sched_attr_t
§impl Default for sched_attr_t
impl Default for sched_attr_t
§fn default() -> sched_attr_t
fn default() -> sched_attr_t
impl Copy for sched_attr_t
Auto Trait Implementations§
impl Freeze for sched_attr_t
impl RefUnwindSafe for sched_attr_t
impl Send for sched_attr_t
impl Sync for sched_attr_t
impl Unpin for sched_attr_t
impl UnwindSafe for sched_attr_t
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.