The MPAM MBA enablement carried in this tree exposes memory-bandwidth
allocation through the resctrl "MB" schemata, but none of it is covered
by the in-tree resctrl selftests: the existing mba_test/mbm_test are
ARCH_INTEL-gated throughput tests that validate against the Intel iMC
PMU and map domains via L3 cache ids, so they skip (and cannot work) on
aarch64/MPAM, where MB domains are NUMA proximity ids. Any regression
in the MB control plane currently ships unnoticed.
Add four deterministic, workload-free ABI tests in a shared
MBA_SCHEMATA group, one resctrl_test entry each:
1. MBA_SCHEMATA_INFO - sane control contract (schema_format, gran,
min_bandwidth, num_closids) and default
schemata at 100% on every domain
2. MBA_SCHEMATA_RW - percentages take effect and read back
exactly, per domain, including restore
3. MBA_SCHEMATA_INVAL - out-of-range/malformed/bad-domain writes
are rejected with the documented
last_cmd_status diagnostics
4. MBA_SCHEMATA_ISOLATE - two groups keep independent caps; the
default group is never perturbed
All cases are feature-gated (schema_format == percentage) and skip
cleanly elsewhere; no workload or measurement is involved, so they are
CI-safe and flake-free. The Intel tests are left untouched. The tests
are written upstream-shaped for eventual submission.
This series applies on top of the 26.04_linux-nvidia.glue.others.
cpu_less.hardlimit branch of
https://github.com/fyu1/NV-Kernels.fenghuay.baseos
Tested on an NVIDIA Grace (Vera) system with MPAM MBA enabled (two MB
domains): sudo ./resctrl_tests -t MBA_SCHEMATA -> 4/4 pass.
The newly added test file fires a warning when using checkpatch.pl .
Richard Cheng (4):
selftests/resctrl: Add MBA schemata info selftest
selftests/resctrl: Add MBA schemata write/read-back selftest
selftests/resctrl: Add MBA schemata invalid-write selftest
selftests/resctrl: Add MBA schemata per-group isolation selftest
.../selftests/resctrl/mba_schemata_test.c | 521 ++++++++++++++++++
tools/testing/selftests/resctrl/resctrl.h | 7 +
.../testing/selftests/resctrl/resctrl_tests.c | 4 +
tools/testing/selftests/resctrl/resctrlfs.c | 157 ++++++
4 files changed, 689 insertions(+)
create mode 100644 tools/testing/selftests/resctrl/mba_schemata_test.c
base-commit: 475f355d0408698d9f632ba3b9a5dfb1f91e928b
--
2.43.0