Skip to content

Commit 5247e6d

Browse files
ij-intelshuahkh
authored andcommitted
selftests/resctrl: Fix MBM test failure when MBA unavailable
Commit 20d96b2 ("selftests/resctrl: Fix schemata write error check") exposed a problem in feature detection logic in MBM selftest. If schemata does not support MB:x=x entries, the schemata write to initialize 100% memory bandwidth allocation in mbm_setup() will now fail with -EINVAL due to the error handling corrected by the commit 20d96b2 ("selftests/resctrl: Fix schemata write error check"). That commit just uncovers the failed write, it is not wrong itself. If MB:x=x is not supported by schemata, it is safe to assume 100% memory bandwidth is always set. Therefore, the previously ignored error does not make the MBM test itself wrong. Restore the previous behavior of MBM test by checking MB support before attempting to write it into schemata which results in behavior equivalent to ignoring the write error. Fixes: 20d96b2 ("selftests/resctrl: Fix schemata write error check") 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>
1 parent 34dce23 commit 5247e6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/resctrl/mbm_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int mbm_setup(struct resctrl_val_param *p)
9595
return END_OF_TESTS;
9696

9797
/* Set up shemata with 100% allocation on the first run. */
98-
if (p->num_of_runs == 0)
98+
if (p->num_of_runs == 0 && validate_resctrl_feature_request("MB", NULL))
9999
ret = write_schemata(p->ctrlgrp, "100", p->cpu_no,
100100
p->resctrl_val);
101101

0 commit comments

Comments
 (0)