Module scenarios

Module scenarios 

Source
Expand description

Curated canned scenarios for common scheduler test patterns.

Each function takes a Ctx and returns Result<AssertResult>. These are thin wrappers over existing scenario implementations, providing better names in a single discoverable namespace.

§Categories

  • Basic: steady-state cgroups with no dynamic ops.
  • Cpuset: cpuset assignment and mid-run mutation.
  • Dynamic: cgroup add/remove during a running workload.
  • Affinity: per-worker CPU affinity patterns.
  • Stress: host/cgroup contention and mixed workload types.
  • Nested: workers in nested sub-cgroups.

§Example

use ktstr::prelude::*;

#[ktstr_test(llcs = 2, cores = 4, threads = 1)]
fn test_steady(ctx: &Ctx) -> Result<AssertResult> {
    scenarios::steady(ctx)
}

Functions§

affinity_change
Two cgroups with worker affinities randomized mid-run.
affinity_pinned
Two cgroups with workers pinned to a 2-CPU subset.
cgroup_add
Two cgroups initially, then one or two more added mid-run.
cgroup_remove
Four cgroups initially, then the second half removed mid-run.
cpuset_apply
Two cgroups start without cpusets, then get disjoint cpusets mid-run.
cpuset_clear
Two cgroups start with disjoint cpusets, then cpusets are cleared mid-run.
cpuset_resize
Two cgroups with cpusets that shrink then grow.
host_contention
Host workers competing with cgroup workers for CPU time.
mixed_workloads
Heavy + bursty + IO cgroups.
nested_steady
Workers in nested sub-cgroups.
nested_task_move
Move tasks between nested cgroups.
oversubscribed
Two cgroups with 32 mixed workers each (oversubscribed).
steady
Two cgroups, no cpusets, equal CPU-spin load.
steady_llc
Two cgroups with LLC-aligned cpusets.