diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-12-15 18:05:09 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-02-13 23:56:45 +0300 |
commit | 6c8cb747d071cf72c2930e09bb20ab3eabfe62ff (patch) | |
tree | f8d901c3a8c414569a524e033c606830ae17d00d /tools/testing/selftests/resctrl/resctrl.h | |
parent | 205de6ddd7fff9340bd5e4b68105f28120671c6b (diff) | |
download | linux-6c8cb747d071cf72c2930e09bb20ab3eabfe62ff.tar.xz |
selftests/resctrl: Restore the CPU affinity after CAT test
CAT test does not reset the CPU affinity after the benchmark.
This is relatively harmless as is because CAT test is the last
benchmark to run, however, more tests may be added later.
Store the CPU affinity the first time taskset_benchmark() is run and
add taskset_restore() which the test can call to reset the CPU mask to
its original value.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl.h')
-rw-r--r-- | tools/testing/selftests/resctrl/resctrl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 4f040e999eea..94347acafe55 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -98,7 +98,8 @@ int umount_resctrlfs(void); int validate_bw_report_request(char *bw_report); bool validate_resctrl_feature_request(const char *resource, const char *feature); char *fgrep(FILE *inf, const char *str); -int taskset_benchmark(pid_t bm_pid, int cpu_no); +int taskset_benchmark(pid_t bm_pid, int cpu_no, cpu_set_t *old_affinity); +int taskset_restore(pid_t bm_pid, cpu_set_t *old_affinity); int write_schemata(char *ctrlgrp, char *schemata, int cpu_no, char *resctrl_val); int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp, |