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Β§
StructsΒ§
- BpfLinks
- BpfMaps
- BpfProgs
- BpfSkel
- BpfSkel
Builder - Cgroup
Reader π - Read process membership from the hostβs unified cgroup hierarchy.
- Dynamic
Threshold πState - State for EMA-based dynamic threshold adjustment with hysteresis.
- Metrics π
- Open
BpfMaps - Open
BpfProgs - Open
BpfSkel - Opts π
- Owned
Ref - Scheduler π
- Struct
Ops
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 π