* [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable
@ 2023-10-18 7:55 Ilpo Järvinen
2023-10-18 8:10 ` Ilpo Järvinen
0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2023-10-18 7:55 UTC (permalink / raw)
To: Fenghua Yu, Reinette Chatre, Shuah Khan, Maciej Wieczor-Retman,
Ilpo Järvinen, linux-kernel, linux-kselftest
Commit 20d96b25cc4c ("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
20d96b25cc4c ("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: 20d96b25cc4c ("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>
---
tools/testing/selftests/resctrl/mbm_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
index d3c0d30c676a..741533f2b075 100644
--- a/tools/testing/selftests/resctrl/mbm_test.c
+++ b/tools/testing/selftests/resctrl/mbm_test.c
@@ -95,7 +95,7 @@ static int mbm_setup(struct resctrl_val_param *p)
return END_OF_TESTS;
/* Set up shemata with 100% allocation on the first run. */
- if (p->num_of_runs == 0)
+ if (p->num_of_runs == 0 && validate_resctrl_feature_request("MB", NULL))
ret = write_schemata(p->ctrlgrp, "100", p->cpu_no,
p->resctrl_val);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable
2023-10-18 7:55 [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable Ilpo Järvinen
@ 2023-10-18 8:10 ` Ilpo Järvinen
2023-10-18 19:07 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2023-10-18 8:10 UTC (permalink / raw)
To: Reinette Chatre, Shuah Khan
Cc: Maciej Wieczor-Retman, LKML, linux-kselftest, Fenghua Yu
[-- Attachment #1: Type: text/plain, Size: 2359 bytes --]
On Wed, 18 Oct 2023, Ilpo Järvinen wrote:
> Commit 20d96b25cc4c ("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
> 20d96b25cc4c ("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: 20d96b25cc4c ("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>
> ---
It seems it's too early morning for me so I entirely forgot to describe
the changes I made... doh. So here it is (nothing earth-shattering here
really):
v2:
- Make checkpatch --strict happy.
- Remove () that --strict called "extra".
- Duplicate the referenced commit description in the changelog
to follow the commit formatting guidelines.
- Alter the wording at one of the references into the commit
20d96b25cc4c in order to avoid having to copy the description
there too.
- Added Reinette's rev-by.
--
i.
> tools/testing/selftests/resctrl/mbm_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
> index d3c0d30c676a..741533f2b075 100644
> --- a/tools/testing/selftests/resctrl/mbm_test.c
> +++ b/tools/testing/selftests/resctrl/mbm_test.c
> @@ -95,7 +95,7 @@ static int mbm_setup(struct resctrl_val_param *p)
> return END_OF_TESTS;
>
> /* Set up shemata with 100% allocation on the first run. */
> - if (p->num_of_runs == 0)
> + if (p->num_of_runs == 0 && validate_resctrl_feature_request("MB", NULL))
> ret = write_schemata(p->ctrlgrp, "100", p->cpu_no,
> p->resctrl_val);
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable
2023-10-18 8:10 ` Ilpo Järvinen
@ 2023-10-18 19:07 ` Shuah Khan
0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2023-10-18 19:07 UTC (permalink / raw)
To: Ilpo Järvinen, Reinette Chatre, Shuah Khan
Cc: Maciej Wieczor-Retman, LKML, linux-kselftest, Fenghua Yu,
Shuah Khan
On 10/18/23 02:10, Ilpo Järvinen wrote:
> On Wed, 18 Oct 2023, Ilpo Järvinen wrote:
>
>> Commit 20d96b25cc4c ("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
>> 20d96b25cc4c ("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: 20d96b25cc4c ("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>
>> ---
>
> It seems it's too early morning for me so I entirely forgot to describe
> the changes I made... doh. So here it is (nothing earth-shattering here
> really):
>
> v2:
> - Make checkpatch --strict happy.
> - Remove () that --strict called "extra".
> - Duplicate the referenced commit description in the changelog
> to follow the commit formatting guidelines.
> - Alter the wording at one of the references into the commit
> 20d96b25cc4c in order to avoid having to copy the description
> there too.
> - Added Reinette's rev-by.
>
Thank you. Applied to linux-kselftest next for Linux 6.7-rc1
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-18 19:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 7:55 [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable Ilpo Järvinen
2023-10-18 8:10 ` Ilpo Järvinen
2023-10-18 19:07 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).