Enum oxidebpf::SchedulingPolicy
source · [−]pub enum SchedulingPolicy {
Other(i8),
Idle,
Batch(i8),
FIFO(u8),
RR(u8),
Deadline(u64, u64, u64),
}
Expand description
Different Linux scheduling policies, intended to be paired with a priority number in the
builder function polling_thread_priority
of
ProgramGroup
.
Variants
Other(i8)
The default Linux scheduling technique. When paired with a priority number, the priority number will be interpreted as a niceness value (-20 to 19, inclusive).
Idle
The lowest possible priority on the system. This cannot be modified by a niceness value, and provided numbers will be ignored.
Batch(i8)
Similar to Other, except the scheduler will always assume this thread is CPU-intensive for scheduling purposes. Any provided priority number will be interpreted as a niceness value (-20 to 19, inclusive).
FIFO(u8)
Use first-in-first-out scheduling for this thread. The provided priority value will be the thread’s overall priority (0 to 99, inclusive). Note that the polling thread will not be preempted (unless by a higher priority process) when using this policy, until it finishes processing a batch and blocks on polling.
RR(u8)
A Round-Robin modification of the FIFO scheduling policy that preempts the process after reaching some maximum time quantum limit, and puts it at the back of the queue. The provided priority should be the same as FIFO (0 to 99, inclusive).
Deadline(u64, u64, u64)
The deadline policy attempts to finish periodic jobs by a certain deadline. It takes
three numbers: the job’s expected runtime, the job’s deadline time, and
the job’s period, all in nanoseconds. See the following diagram from the sched
manpage:
arrival/wakeup absolute deadline
| start time |
| | |
v v v
-----x--------xooooooooooooooooo--------x--------x---
|<-- Runtime ------->|
|<----------- Deadline ----------->|
|<-------------- Period ------------------->|
The provided priority number will be interpreted as the estimated runtime, the deadline, and the period (the kernel enforces runtime <= deadline <= period).
Trait Implementations
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for SchedulingPolicy
impl Send for SchedulingPolicy
impl Sync for SchedulingPolicy
impl Unpin for SchedulingPolicy
impl UnwindSafe for SchedulingPolicy
Blanket Implementations
Mutably borrows from an owned value. Read more