summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/resctrl_tests.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2024-10-24 14:18:45 -0700
committerShuah Khan <skhan@linuxfoundation.org>2024-11-04 17:02:03 -0700
commit138424170eb06c956bc7e77e8740479161f65463 (patch)
tree9141aaec75e187199eb87330138c437a2a6e45e9 /tools/testing/selftests/resctrl/resctrl_tests.c
parentf3069136c95f15c05d166281cbb55f0509a42ae1 (diff)
selftests/resctrl: Only support measured read operation
The CMT, MBM, and MBA tests rely on a benchmark to generate memory traffic. By default this is the "fill_buf" benchmark that can be replaced via the "-b" command line argument. The original intent of the "-b" command line parameter was to replace the default "fill_buf" benchmark, but the implementation also exposes an alternative use case where the "fill_buf" parameters itself can be modified. One of the parameters to "fill_buf" is the "operation" that can be either "read" or "write" and indicates whether the "fill_buf" should use "read" or "write" operations on the allocated buffer. While replacing "fill_buf" default parameters is technically possible, replacing the default "read" parameter with "write" is not supported because the MBA and MBM tests only measure "read" operations. The "read" operation is also most appropriate for the CMT test that aims to use the benchmark to allocate into the cache. Avoid any potential inconsistencies between test and measurement by removing code for unsupported "write" operations to the buffer. Ignore any attempt from user space to enable this unsupported test configuration, instead always use read operations. Keep the initialization of the, now unused, "fill_buf" parameters to reserve these parameter positions since it has been exposed as an API. Future parameter additions cannot use these parameter positions. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl_tests.c')
-rw-r--r--tools/testing/selftests/resctrl/resctrl_tests.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index e7878077883f..0f91c475b255 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -265,13 +265,16 @@ last_arg:
ksft_exit_fail_msg("Out of memory!\n");
uparams.benchmark_cmd[1] = span_str;
uparams.benchmark_cmd[2] = "1";
- uparams.benchmark_cmd[3] = "0";
/*
+ * Third parameter was previously used for "operation"
+ * (read/write) of which only (now default) "read"/"0"
+ * works.
* Fourth parameter was previously used to indicate
* how long "fill_buf" should run for, with "false"
* ("fill_buf" will keep running until terminated)
* the only option that works.
*/
+ uparams.benchmark_cmd[3] = NULL;
uparams.benchmark_cmd[4] = NULL;
}