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.