selftests/resctrl: Add MBA test
authorFenghua Yu <fenghua.yu@intel.com>
Thu, 16 Jan 2020 21:32:40 +0000 (13:32 -0800)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 11 Feb 2020 01:42:46 +0000 (18:42 -0700)
commit01fee6b4d1f93247e806dddb0065b88317949085
treeea8469cb32e4d0fc2cbd539f4f2a9968a57d9990
parentecdbb911f22d6cc5d422571dedf048b889d71417
selftests/resctrl: Add MBA test

MBA (Memory Bandwidth Allocation) test starts a stressful memory
bandwidth benchmark and allocates memory bandwidth from 100% down
to 10% for the benchmark process. For each allocation, compare
perf IMC counter and mbm total bytes from resctrl. The difference
between the two values should be within a threshold to pass the test.

Default benchmark is built-in fill_buf. But users can specify their
own benchmark by option "-b".

We can add memory bandwidth allocation for multiple processes in the
future.

Co-developed-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Co-developed-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/mba_test.c [new file with mode: 0644]
tools/testing/selftests/resctrl/resctrl.h
tools/testing/selftests/resctrl/resctrl_tests.c