Skip to main content

Module tiers

Module tiers 

Source
Expand description

CPU capacities and asymmetric packing priorities, the loader’s half of scx_rustsched’s tiers.rs and topology.rs. The capacities and the scheduling-domain spans come from scx_utils’ Topology. The ITMT priority and SD_ASYM_PACKING come from the kernel through the rust_cpu_priority() syscall program, since neither has a user-space ABI. The result goes to the BPF program per CPU, which translates it to CIDs at init.

Capacity and packing are separate kernel policies with separate tiers, 0 the most preferred in both. Capacity tiers group CPUs of close capacity; packing tiers group CPUs of equal priority, or follow the capacity tiers when the kernel does not pack.

Re-exports§

use std::ffi::OsStr; 🔒
use anyhow::Context; 🔒
use anyhow::Result; 🔒
use anyhow::bail; 🔒
use anyhow::ensure; 🔒
use libbpf_rs::Btf; 🔒
use libbpf_rs::MapCore; 🔒
use libbpf_rs::MapFlags; 🔒
use libbpf_rs::Object; 🔒
use libbpf_rs::ProgramInput; 🔒
use libbpf_rs::btf::types::Composite; 🔒
use libbpf_rs::btf::types::Enum; 🔒
use libbpf_rs::btf::types::MemberAttr; 🔒
use libbpf_rs::btf::types::Struct; 🔒

Structs§

Cpu
Tiers

Enums§

CapacityMode
How capacities are chosen.

Constants§

MAX_CPUS
The BPF program’s per-CPU table, see scx_rustsched’s tiers.rs.

Functions§

capacity_tiers
Assign sorted, descending capacities to tiers. Each capacity is compared with the fastest CPU of the current tier rather than the previous CPU, so that a chain of small steps does not merge CPUs far apart.
domain_flags 🔒
The SD_ASYM_PACKING and SD_SHARE_CPUCAPACITY bits, enumerators of an anonymous kernel enum.
domain_offsets 🔒
struct sched_domain’s flags and child offsets.
priority_tiers
Packing tiers from (cpu, priority) pairs: equal priorities share a tier, the highest priority is tier 0. Returns the tier per pair, in the order given.