pub(crate) struct Opts {Show 30 fields
pub(crate) verbose: u8,
pub(crate) autopilot: bool,
pub(crate) autopower: bool,
pub(crate) performance: bool,
pub(crate) powersave: bool,
pub(crate) balanced: bool,
pub(crate) slice_max_us: u64,
pub(crate) slice_min_us: u64,
pub(crate) mig_delta_pct: u8,
pub(crate) pinned_slice_us: Option<u64>,
pub(crate) preempt_shift: u8,
pub(crate) cpu_pref_order: String,
pub(crate) no_use_em: bool,
pub(crate) no_futex_boost: bool,
pub(crate) no_preemption: bool,
pub(crate) no_wake_sync: bool,
pub(crate) no_slice_boost: bool,
pub(crate) per_cpu_dsq: bool,
pub(crate) enable_cpu_bw: bool,
pub(crate) no_core_compaction: bool,
pub(crate) no_freq_scaling: bool,
pub(crate) stats: Option<f64>,
pub(crate) monitor: Option<f64>,
pub(crate) monitor_sched_samples: Option<u64>,
pub(crate) log_level: String,
pub(crate) version: bool,
pub(crate) run_id: Option<u64>,
pub(crate) help_stats: bool,
pub libbpf: LibbpfOpts,
pub(crate) topology: Option<TopologyArgs>,
}Expand description
scx_lavd: Latency-criticality Aware Virtual Deadline (LAVD) scheduler
The rust part is minimal. It processes command line options and logs out scheduling statistics. The BPF part makes all the scheduling decisions. See the more detailed overview of the LAVD design at main.bpf.c.
Fields§
§verbose: u8Depricated, noop, use RUST_LOG or –log-level instead.
autopilot: boolAutomatically decide the scheduler’s power mode (performance vs. powersave vs. balanced), CPU preference order, etc, based on system load. The options affecting the power mode and the use of core compaction (–autopower, –performance, –powersave, –balanced, –no-core-compaction) cannot be used with this option. When no option is specified, this is a default mode.
autopower: boolAutomatically decide the scheduler’s power mode (performance vs. powersave vs. balanced) based on the system’s active power profile. The scheduler’s power mode decides the CPU preference order and the use of core compaction, so the options affecting these (–autopilot, –performance, –powersave, –balanced, –no-core-compaction) cannot be used with this option.
performance: boolRun the scheduler in performance mode to get maximum performance. This option cannot be used with other conflicting options (–autopilot, –autopower, –balanced, –powersave, –no-core-compaction) affecting the use of core compaction.
powersave: boolRun the scheduler in powersave mode to minimize powr consumption. This option cannot be used with other conflicting options (–autopilot, –autopower, –performance, –balanced, –no-core-compaction) affecting the use of core compaction.
balanced: boolRun the scheduler in balanced mode aiming for sweetspot between power and performance. This option cannot be used with other conflicting options (–autopilot, –autopower, –performance, –powersave, –no-core-compaction) affecting the use of core compaction.
slice_max_us: u64Maximum scheduling slice duration in microseconds.
slice_min_us: u64Minimum scheduling slice duration in microseconds.
mig_delta_pct: u8Migration delta threshold percentage (0-100). When set to a non-zero value, uses average utilization for threshold calculation instead of current utilization, and the threshold is calculated as: avg_load * (mig-delta-pct / 100). Additionally, disables force task stealing in the consume path, relying only on the is_stealer/is_stealee thresholds for more predictable load balancing. Default is 0 (disabled, uses dynamic threshold based on load with both probabilistic and force task stealing enabled). This is an experimental feature.
pinned_slice_us: Option<u64>Slice duration in microseconds to use for all tasks when pinned tasks are running on a CPU. Must be between slice-min-us and slice-max-us. When this option is enabled, pinned tasks are always enqueued to per-CPU DSQs and the dispatch logic compares vtimes across all DSQs to select the lowest vtime task. This helps improve responsiveness for pinned tasks. By default, this option is on with a default value of 5000 (5 msec). To turn off the option, explicitly set the value to 0.
preempt_shift: u8Limit the ratio of preemption to the roughly top P% of latency-critical tasks. When N is given as an argument, P is 0.5^N * 100. The default value is 6, which limits the preemption for the top 1.56% of latency-critical tasks.
cpu_pref_order: StringList of CPUs in preferred order (e.g., “0-3,7,6,5,4”). The scheduler uses the CPU preference mode only when the core compaction is enabled (i.e., balanced or powersave mode is specified as an option or chosen in the autopilot or autopower mode). When “–cpu-pref-order” is given, it implies “–no-use-em”.
no_use_em: boolDo not use the energy model in making CPU preference order decisions.
no_futex_boost: boolDo not boost futex holders.
no_preemption: boolDisable preemption.
no_wake_sync: boolDisable an optimization for synchronous wake-up.
no_slice_boost: boolDisable dynamic slice boost for long-running tasks.
per_cpu_dsq: boolEnables DSQs per CPU, this enables task queuing and dispatching from CPU specific DSQs. This generally increases L1/L2 cache locality for tasks and lowers lock contention compared to shared DSQs, but at the cost of higher load balancing complexity. This is a highly experimental feature.
enable_cpu_bw: boolEnable CPU bandwidth control using cpu.max in cgroup v2. This is a highly experimental feature.
no_core_compaction: boolDisable core compaction so the scheduler uses all the online CPUs. The core compaction attempts to minimize the number of actively used CPUs for unaffinitized tasks, respecting the CPU preference order. Normally, the core compaction is enabled by the power mode (i.e., balanced or powersave mode is specified as an option or chosen in the autopilot or autopower mode). This option cannot be used with the other options that control the core compaction (–autopilot, –autopower, –performance, –balanced, –powersave).
no_freq_scaling: boolDisable controlling the CPU frequency.
stats: Option<f64>Enable stats monitoring with the specified interval.
monitor: Option<f64>Run in stats monitoring mode with the specified interval. Scheduler is not launched.
monitor_sched_samples: Option<u64>Run in monitoring mode. Show the specified number of scheduling samples every second.
log_level: StringSpecify the logging level. Accepts rust’s envfilter syntax for modular logging: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax. Examples: [“info”, “warn,tokio=info”]
version: boolPrint scheduler version and exit.
run_id: Option<u64>Optional run ID for tracking scheduler instances.
help_stats: boolShow descriptions for statistics.
libbpf: LibbpfOpts§topology: Option<TopologyArgs>Topology configuration options
Implementations§
Source§impl Opts
impl Opts
pub(crate) fn can_autopilot(&self) -> bool
pub(crate) fn can_autopower(&self) -> bool
pub(crate) fn can_performance(&self) -> bool
pub(crate) fn can_balanced(&self) -> bool
pub(crate) fn can_powersave(&self) -> bool
pub(crate) fn proc(&mut self) -> Option<&mut Self>
pub(crate) fn preempt_shift_range(s: &str) -> Result<u8, String>
pub(crate) fn mig_delta_pct_range(s: &str) -> Result<u8, String>
Trait Implementations§
Source§impl Args for Opts
impl Args for Opts
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl FromArgMatches for Opts
impl FromArgMatches for Opts
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Opts
impl Parser for Opts
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for Opts
impl RefUnwindSafe for Opts
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl UnwindSafe for Opts
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.