Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Gauntlet

The gauntlet runs every test across 24 topology presets (14 on aarch64). Gauntlet variants are prefixed with gauntlet/ and ignored by default.

# Run only base tests (default)
cargo ktstr test --kernel ../linux

# Run only gauntlet variants
cargo ktstr test --kernel ../linux -- --run-ignored ignored-only -E 'test(gauntlet/)'

# Run everything
cargo ktstr test --kernel ../linux -- --run-ignored all

Entries with host_only = true never produce gauntlet variants (topology variation is meaningless without a VM). See host_only for how that flag is set.

Variant naming

Single-kernel runs name each gauntlet variant gauntlet/{test_name}/{preset}:

  • {test_name} – the #[ktstr_test] function name
  • {preset} – one of the topology preset names below

When --kernel resolves to two or more kernels (multiple --kernel flags or a START..END range that expands to several releases), cargo ktstr test / coverage / llvm-cov add the kernel as a third dimension and append a {kernel_label} suffix: gauntlet/{test_name}/{preset}/{kernel_label}. See Multi-kernel: kernel as a gauntlet dimension for how the kernel labels are derived (sanitized from the resolved version, range expansion, cache key, git source, or path basename).

To run a single variant:

cargo ktstr test --kernel ../linux -- --run-ignored ignored-only \
  -E 'test(=gauntlet/my_test/smt-2llc)'

Topology presets

PresetTopologyCPUsLLCsNUMADescription
tiny-1llc1n1l4c1t411Single LLC
tiny-2llc1n2l2c1t421Minimal multi-LLC
odd-3llc1n3l3c1t931Odd CPU count
odd-5llc1n5l3c1t1551Prime LLC count
odd-7llc1n7l2c1t1471Prime LLC count
smt-2llc1n2l2c2t821SMT enabled
smt-3llc1n3l2c2t1231SMT, 3 LLCs
medium-4llc1n4l4c2t3241Medium topology
medium-8llc1n8l4c2t6481Medium, many LLCs
large-4llc1n4l16c2t12841Large, few LLCs
large-8llc1n8l8c2t12881Large, many LLCs
near-max-llc1n15l8c2t240151Near maximum
max-cpu1n14l9c2t252141Near KVM vCPU limit
medium-4llc-nosmt1n4l8c1t3241Medium, no SMT
medium-8llc-nosmt1n8l8c1t6481Medium, many LLCs, no SMT
large-4llc-nosmt1n4l32c1t12841Large, no SMT
large-8llc-nosmt1n8l16c1t12881Large, many LLCs, no SMT
near-max-llc-nosmt1n15l16c1t240151Near maximum, no SMT
max-cpu-nosmt1n14l18c1t252141Near KVM vCPU limit, no SMT
numa2-4llc2n4l4c1t1642Multi-NUMA, 2 nodes
numa2-8llc2n8l8c2t12882Multi-NUMA, 2 nodes, SMT
numa2-8llc-nosmt2n8l16c1t12882Multi-NUMA, 2 nodes, no SMT
numa4-8llc4n8l4c1t3284Multi-NUMA, 4 nodes
numa4-12llc4n12l8c2t192124Multi-NUMA, 4 nodes, SMT

Topology format: {numa_nodes}n{llcs}l{cores_per_llc}c{threads_per_core}t (e.g. 1n2l4c2t = 1 NUMA node, 2 LLCs, 4 cores per LLC, 2 threads per core = 16 CPUs). Presets are defined in gauntlet_presets(). Multi-NUMA presets are excluded by default (max_numa_nodes: Some(1) in TopologyConstraints::DEFAULT), so tests opt in to NUMA testing by raising max_numa_nodes.

aarch64: ARM64 CPUs do not have SMT. Presets with threads_per_core > 1 are excluded on aarch64, leaving 14 presets (the 5 small presets, 6 -nosmt variants, and 3 non-SMT NUMA presets).

Constraint filtering

#[ktstr_test] topology constraints filter which presets a test runs on. A preset is skipped when any constraint is not met:

  • num_numa_nodes() < min_numa_nodes
  • max_numa_nodes is set and num_numa_nodes() > max_numa_nodes
  • num_llcs() < min_llcs
  • max_llcs is set and num_llcs() > max_llcs
  • requires_smt and threads_per_core < 2
  • total_cpus() < min_cpus
  • max_cpus is set and total_cpus() > max_cpus

See Topology Constraints for the full attribute table and Gauntlet Tests for a worked example showing which presets survive a given constraint set.

Budget interaction

When KTSTR_BUDGET_SECS is set, greedy coverage maximization selects the most diverse set of test configurations within the time budget. Each candidate test is represented as a feature bitset (CPU count bucket, LLC count, SMT vs non-SMT, etc.). The selector greedily picks tests that cover the most uncovered feature bits per estimated second. The result is a mix of base tests and gauntlet variants that maximizes configuration diversity within the budget.

See Budget-based test selection.

Memory allocation

Each gauntlet VM gets max(topology_mb, initramfs_floor) MB of RAM, where topology_mb = max(cpus * 64, 256, entry.memory_mb) is the topology-requested minimum and initramfs_floor is computed from the actual initramfs size after build. For max-cpu (252 CPUs) the topology minimum is at least 16128 MB.