Skip to content

selftests/resctrl: Add resctrl selftest

Fenghua Yu linux-kselftest 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest posting 2/213 patches 2 repliesIn review
  2. v9 posting 1/213 patches 5 repliesSuperseded
  3. v813 patches 6 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v713 patches23 repliesSuperseded
v613 patches0 repliesSuperseded
v410 patches8 repliesSuperseded
v38 patches5 repliesSuperseded
v28 patches7 repliesSuperseded
v17 patches9 repliesSuperseded

Changes in v9 from the cover letter

- Per Boris suggestion, add Co-developed-by in each patch to make it clear who contributed to the patch set.

Patches in v9 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13selftests/resctrl: Add README for resctrl teststools/testing/selftests/resctrl/README+53 -00 replies
2/13selftests/resctrl: Add basic resctrl file system operations and datatools/testing/selftests/resctrl/Makefile tools/testing/selftests/resctrl/resctrl.h tools/testing/selftests/resctrl/resctrlfs.c+524 -00 replies
3/13selftests/resctrl: Read memory bandwidth from perf IMC counter and from resctrl file systemtools/testing/selftests/resctrl/resctrl_val.c+117 -00 replies
4/13selftests/resctrl: Add callback to start a benchmarktools/testing/selftests/resctrl/resctrl.h tools/testing/selftests/resctrl/resctrl_val.c+603 -00 replies
5/13selftests/resctrl: Add built in benchmarktools/testing/selftests/resctrl/fill_buf.c+207 -00 replies
6/13selftests/resctrl: Add MBM testtools/testing/selftests/resctrl/Makefile tools/testing/selftests/resctrl/mbm_test.c tools/testing/selftests/resctrl/resctrl.h +3 more+368 -10 replies
7/13selftests/resctrl: Add MBA testtools/testing/selftests/resctrl/mba_test.c tools/testing/selftests/resctrl/resctrl.h tools/testing/selftests/resctrl/resctrl_tests.c+188 -10 replies
8/13selftests/resctrl: Add Cache QoS Monitoring (CQM) selftesttools/testing/selftests/resctrl/cache.c tools/testing/selftests/resctrl/cqm_test.c tools/testing/selftests/resctrl/resctrl.h +3 more+558 -200 replies
9/13selftests/resctrl: Add Cache Allocation Technology (CAT) selftesttools/testing/selftests/resctrl/cache.c tools/testing/selftests/resctrl/cat_test.c tools/testing/selftests/resctrl/fill_buf.c +3 more+451 -50 replies
10/13selftests/resctrl: Add vendor detection mechanismtools/testing/selftests/resctrl/resctrl.h tools/testing/selftests/resctrl/resctrl_tests.c+25 -00 replies
11/13selftests/resctrl: Use cache index3 id for AMD schemata maskstools/testing/selftests/resctrl/resctrlfs.c+7 -20 replies
12/13selftests/resctrl: Disable MBA and MBM tests for AMDtools/testing/selftests/resctrl/cat_test.c tools/testing/selftests/resctrl/resctrl_tests.c+4 -40 replies
13/13selftests/resctrl: Add the test in MAINTAINERSMAINTAINERS+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v9 yet.

Read the v9 thread

Cover letter [RESEND PATCH v9 00/13] selftests/resctrl: Add resctrl selftest

[Resend the v9 patch set to Shuah Khan and linux-kselftest mailing list. No code and commit message change.]

With more and more resctrl features are being added by Intel, AMD and ARM, a test tool is becoming more and more useful to validate that both hardware and software functionalities work as expected.

We introduce resctrl selftest to cover resctrl features on X86, AMD and ARM architectures. It first implements MBM (Memory Bandwidth Monitoring), MBA (Memory Bandwidth Allocation), L3 CAT (Cache Allocation Technology), and CQM (Cache QoS Monitoring) tests. We will enhance the selftest tool to include more functionality tests in the future.

The tool has been tested on Intel RDT, AMD QoS and ARM MPAM and is in tools/testing/selftests/resctrl in order to have generic test code base for all architectures.

The selftest tool we are introducing here provides a convenient tool which does automatic resctrl testing, is easily available in kernel tree, and covers Intel RDT, AMD QoS and ARM MPAM.

There is an existing resctrl test suite 'intel_cmt_cat'. But its major purpose is to test Intel RDT hardware via writing and reading MSR registers. It does access resctrl file system; but the functionalities are very limited. And it doesn't support automatic test and a lot of manual verifications are involved.

Changelog:
v9:
- Per Boris suggestion, add Co-developed-by in each patch to make it clear who contributed to the patch set.

v8:
Update code per comments from Andre Przywara from ARM:
- Change Makefile and remove inline assembly code to build and test the tool on ARM
- Change the output to TAP format because the format is both readable by human and other test tools.
- Detect resctrl feature from /proc/cpuinfo instead of dmesg to support generic detection on all architectures.
- Fix a few coding issues.

v7:
- Fix a few warnings when compiling patches separately, pointed by Babu

v6:
- Fix a benchmark reading optimized out issue in newer GCC.
- Fix a few coding style issues.
- Re-arrange code among patches to make cleaner code. No change in patches structure.

v5:
- Based the v4 patches submitted by Fenghua Yu and added changes to support AMD.
- Changed the function name get_sock_num to get_resource_id. Intel uses socket number for schemata and AMD uses l3 index id. To generalize, changed the function name to get_resource_id.
- Added the code to detect vendor.
- Disabled the few tests for AMD where the test results are not clear. Also AMD does not have IMC.
- Fixed few compile issues.
- Some cleanup to make each patch independent.
- Tested the patches on AMD system. Fenghua, Need your help to test on Intel box. Please feel free to change and resubmit if something broken.

v4:
- address comments from Balu and Randy
- Add CAT and CQM tests

v3:
- Change code based on comments from Babu Moger
- Remove some unnessary code and use pipe to communicate b/w processes

v2:
- Change code based on comments from Babu Moger
- Clean up other places.

Babu Moger (3):
selftests/resctrl: Add vendor detection mechanism selftests/resctrl: Use cache index3 id for AMD schemata masks selftests/resctrl: Disable MBA and MBM tests for AMD

Fenghua Yu (6):
selftests/resctrl: Add README for resctrl tests selftests/resctrl: Add MBM test
selftests/resctrl: Add MBA test
selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest selftests/resctrl: Add Cache Allocation Technology (CAT) selftest selftests/resctrl: Add the test in MAINTAINERS

Sai Praneeth Prakhya (4):
selftests/resctrl: Add basic resctrl file system operations and data selftests/resctrl: Read memory bandwidth from perf IMC counter and
from resctrl file system
selftests/resctrl: Add callback to start a benchmark selftests/resctrl: Add built in benchmark

 MAINTAINERS                                   |   1 +
 tools/testing/selftests/resctrl/Makefile      |  17 +
 tools/testing/selftests/resctrl/README        |  53 ++
 tools/testing/selftests/resctrl/cache.c       | 272 +++++++
 tools/testing/selftests/resctrl/cat_test.c    | 250 ++++++
 tools/testing/selftests/resctrl/cqm_test.c    | 176 +++++
 tools/testing/selftests/resctrl/fill_buf.c    | 213 +++++
 tools/testing/selftests/resctrl/mba_test.c    | 171 ++++
 tools/testing/selftests/resctrl/mbm_test.c    | 145 ++++
 tools/testing/selftests/resctrl/resctrl.h     | 107 +++
 .../testing/selftests/resctrl/resctrl_tests.c | 202 +++++
 tools/testing/selftests/resctrl/resctrl_val.c | 744 ++++++++++++++++++
 tools/testing/selftests/resctrl/resctrlfs.c   | 722 +++++++++++++++++
 13 files changed, 3073 insertions(+)
 create mode 100644 tools/testing/selftests/resctrl/Makefile
 create mode 100644 tools/testing/selftests/resctrl/README
 create mode 100644 tools/testing/selftests/resctrl/cache.c
 create mode 100644 tools/testing/selftests/resctrl/cat_test.c
 create mode 100644 tools/testing/selftests/resctrl/cqm_test.c
 create mode 100644 tools/testing/selftests/resctrl/fill_buf.c
 create mode 100644 tools/testing/selftests/resctrl/mba_test.c
 create mode 100644 tools/testing/selftests/resctrl/mbm_test.c
 create mode 100644 tools/testing/selftests/resctrl/resctrl.h
 create mode 100644 tools/testing/selftests/resctrl/resctrl_tests.c
 create mode 100644 tools/testing/selftests/resctrl/resctrl_val.c
 create mode 100644 tools/testing/selftests/resctrl/resctrlfs.c
Signature · 1 line
2.19.1