Core Concepts
ktstr tests compose from four layers:
-
Scenarios – what to test: cgroup layout, CPU partitioning, workloads, custom logic.
-
Flags – which scheduler features to enable for each run.
-
WorkSpec types – what each worker process does: CPU spin, yield, I/O, bursty patterns, pipe-based IPC.
-
Checking – how to evaluate results: starvation, fairness, isolation, scheduling gaps, monitor thresholds.
These compose orthogonally. A scenario runs with every valid flag combination, and checks apply uniformly across all runs.
Four supporting concepts complete the picture:
Ops and Steps is the primary API for defining
scenarios – most tests use CgroupDef and execute_defs from
this module. TestTopology provides CPU and
LLC layout for cpuset partitioning.
Performance Mode applies host-side
isolation for noise-sensitive measurements.
Resource Budget describes the
--cpu-cap tier that coordinates concurrent no-perf-mode VMs and
kernel builds via LLC flocks and cgroup v2 cpuset sandboxes.