Skip to main content

Crate scx_rustsched_abi

Crate scx_rustsched_abi 

Source
Expand description

What a Rust BPF sched_ext scheduler and its loader agree on: the layout of the configuration table, .rodata.config, that the loader fills in from the running kernel’s BTF before the object is loaded, and that the BPF side reads by index. Both sides depend on this crate, which compiles for the BPF target and the host.

Every entry is a u64; an offset or enumerator the kernel lacks reads as 0. A scheduler’s own settings are not here: they are its tunables, which the BPF side declares.

Modules§

runtime
The bits of RUNTIME_OPTIONS: what a scheduler asks of the runtime’s topology, idle scans and clock, rather than of its own policy.

Constants§

ARENA_PAGES
Pages the task context pool starts with.
BW_BURST
BW_PERIOD
scx_cgroup_init_args.bw_period_us, bw_quota_us and bw_burst_us.
BW_QUOTA
CPUS_PTR
task_struct.cpus_ptr.
CPU_CSS
CUSTOM_SLICE
task_struct.se.custom_slice and se.slice, a request set with sched_setattr().
DSQ_VTIME
task_struct.scx.dsq_vtime, where the context address is stashed.
DUMP_AT_JIFFIES
scx_dump_ctx.at_jiffies and at_ns.
DUMP_AT_NS
DUMP_LEN
ENQ_BLOCKED
SCX_ENQ_BLOCKED, 0 where the kernel has no proxy execution for sched_ext, and task_struct.is_blocked, 0 where it has none.
ENQ_CPU_SELECTED
Enqueue flags and re-enqueue reasons, 0 where the kernel has none.
ENQ_IMMED
ENQ_LAST
ENQ_PREEMPT_LAZY
ENQ_REENQ
EXIT_CODE
EXIT_CPU
scx_exit_info fields, exit_cpu plus one, and the dump length.
EXIT_DUMP
EXIT_KIND
scx_exit_info.kind.
EXIT_MSG
EXIT_REASON
IS_BLOCKED
KN_ID
MIGRATION_DISABLED
task_struct.migration_disabled.
NR_CPUS_ALLOWED
task_struct.nr_cpus_allowed.
OPS_FLAGS
The ops flags the scheduler was loaded with: those #[scheduler] declares, as its user space changed them.
PID
POLICY
task_struct.policy.
REENQ_IMMED
REENQ_MASK
REENQ_PREEMPTED
RQ_CLOCK_TASK
rq.clock_task.
RUNNABLE_AT
task_struct.scx.runnable_at and task_struct.pid.
RUNTIME_OPTIONS
The runtime’s own options, a mask of the bits in runtime.
SCX_FLAGS
task_struct.scx.flags.
SCX_SLICE
task_struct.scx.slice, what is left of the task’s slice.
SCX_TID
task_struct.scx.tid.
SD_CLUSTER
SD_GROUPS
sched_domain.groups plus one, sched_group.flags and SD_CLUSTER, 0 where the cluster of a CPU cannot be told.
SE_SLICE
SG_FLAGS
STATIC_PRIO
task_struct.static_prio.
SUM_EXEC_RUNTIME
task_struct.se.sum_exec_runtime: the runtime the kernel has accounted to a task.
TASK_FLAGS
task_struct.flags.
TG_FLAGS
TG_IDLE
TG_KN
cgroup.kn and kernfs_node.id, which give a cgroup’s id, 0 where it cannot be read.
TG_LEVEL
Task group fields, see cgroup.rs: cgroup.level, the online state and flags, the weight, the cpu subsystem’s css pointer and the idle flag.
TG_ONLINE
TG_WEIGHT
TICK_NS
The tick period in ns.
WORDS
Words in the table: the entries below, and room for more.