Skip to main content

Crate scx_cosmos

Crate scx_cosmos 

Source

Re-exportsΒ§

pub(crate) use scx_utils::NR_CPU_IDS; πŸ”’
pub(crate) use HashMap; πŸ”’
pub(crate) use HashSet; πŸ”’
pub(crate) use c_int; πŸ”’
pub(crate) use c_ulong; πŸ”’
pub(crate) use std::mem::MaybeUninit; πŸ”’
pub(crate) use std::sync::Arc; πŸ”’
pub(crate) use std::sync::atomic::AtomicBool; πŸ”’
pub(crate) use std::sync::atomic::Ordering; πŸ”’
pub(crate) use Duration; πŸ”’
pub(crate) use Instant; πŸ”’
pub(crate) use anyhow::Context; πŸ”’
pub(crate) use anyhow::Result; πŸ”’
pub(crate) use anyhow::bail; πŸ”’
pub(crate) use clap::Parser; πŸ”’
pub(crate) use crossbeam::channel::RecvTimeoutError; πŸ”’
pub(crate) use libbpf_rs::MapCore; πŸ”’
pub(crate) use libbpf_rs::MapFlags; πŸ”’
pub(crate) use libbpf_rs::OpenObject; πŸ”’
pub(crate) use libbpf_rs::ProgramInput; πŸ”’
pub(crate) use debug; πŸ”’
pub(crate) use info; πŸ”’
pub(crate) use warn; πŸ”’
pub(crate) use nvml_wrapper::Nvml; πŸ”’
pub(crate) use nvml_wrapper::bitmasks::InitFlags; πŸ”’
pub(crate) use scx_utils::GpuIndex; πŸ”’
pub(crate) use scx_utils::NR_CPU_IDS; πŸ”’
pub(crate) use scx_utils::Powermode; πŸ”’
pub(crate) use scx_utils::Topology; πŸ”’
pub(crate) use scx_utils::UserExitInfo; πŸ”’
pub(crate) use scx_utils::build_id; πŸ”’
pub(crate) use scx_utils::compat; πŸ”’
pub(crate) use scx_utils::get_primary_cpus; πŸ”’
pub(crate) use scx_utils::libbpf_clap_opts::LibbpfOpts; πŸ”’
pub(crate) use scx_utils::perf::PerfEventSpec; πŸ”’
pub(crate) use scx_utils::perf::parse_perf_event; πŸ”’
pub(crate) use scx_utils::perf::setup_perf_events; πŸ”’
pub(crate) use scx_utils::scx_ops_attach; πŸ”’
pub(crate) use scx_utils::scx_ops_load; πŸ”’
pub(crate) use scx_utils::scx_ops_open; πŸ”’
pub(crate) use scx_utils::try_set_rlimit_infinity; πŸ”’
pub(crate) use scx_utils::uei_exited; πŸ”’
pub(crate) use scx_utils::uei_report; πŸ”’
pub use bpf_intf::*;
pub(crate) use scx_stats::prelude::*; πŸ”’

ModulesΒ§

bpf_intf
bpf_skel πŸ”’
cgroup πŸ”’
gpu πŸ”’
imp
stats πŸ”’
types

StructsΒ§

BpfLinks
BpfMaps
BpfProgs
BpfSkel
BpfSkelBuilder
CgroupReader πŸ”’
Read process membership from the host’s unified cgroup hierarchy.
DynamicThresholdState πŸ”’
State for EMA-based dynamic threshold adjustment with hysteresis.
Metrics πŸ”’
OpenBpfMaps
OpenBpfProgs
OpenBpfSkel
Opts πŸ”’
OwnedRef
Scheduler πŸ”’
StructOps

ConstantsΒ§

DYNAMIC_THRESHOLD_EMA_ALPHA πŸ”’
EMA smoothing factor (alpha). Higher values give more weight to recent samples. 0.3 provides good balance between responsiveness and stability.
DYNAMIC_THRESHOLD_HYSTERESIS πŸ”’
Hysteresis band: rate must move by this fraction beyond the target bounds before we act. This prevents oscillation when the rate hovers near the threshold boundaries.
DYNAMIC_THRESHOLD_INIT_VALUE πŸ”’
Initial value for the dynamic threshold (in BPF units).
DYNAMIC_THRESHOLD_MIN_VALUE πŸ”’
Minimum value for the dynamic threshold (in BPF units).
DYNAMIC_THRESHOLD_RATE_HIGH πŸ”’
Target event rate (per second) above which we consider migrations/sticky dispatches too high.
DYNAMIC_THRESHOLD_RATE_LOW πŸ”’
Target event rate (per second) below which we consider migrations/sticky dispatches too low.
DYNAMIC_THRESHOLD_SCALE_MAX πŸ”’
Maximum scale factor when far from target (fast convergence when initial threshold is way off).
DYNAMIC_THRESHOLD_SCALE_MIN πŸ”’
Minimum scale factor when just outside the target band (slow convergence near optimal).
DYNAMIC_THRESHOLD_SLOPE_HIGH πŸ”’
Slope for β€œtoo high” case: scale grows with (rate/HIGH - 1) so we step much harder when rate is many times over target.
DYNAMIC_THRESHOLD_SLOPE_LOW πŸ”’
Slope for β€œtoo low” case: scale grows with deficit so we step harder when rate is near zero.
GPU_SYNC_INTERVAL πŸ”’
Minimum interval between NVML GPU PID syncs. Kept separate from CPU polling so that fast polling (e.g. 100 ms) does not trigger expensive NVML calls every tick.
SCHEDULER_NAME πŸ”’

StaticsΒ§

DATA

FunctionsΒ§

build_skel_config
main πŸ”’
parse_cpu_list