Re: [PATCH 5/6] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth

2024-08-30 Thread Ilpo Järvinen
On Thu, 29 Aug 2024, Reinette Chatre wrote: > The MBA test incrementally throttles memory bandwidth, each time > followed by a comparison between the memory bandwidth observed > by the performance counters and resctrl respectively. > > While a comparison between performance counters and resctrl i

Re: [PATCH 4/6] selftests/resctrl: Use cache size to determine "fill_buf" buffer size

2024-08-30 Thread Ilpo Järvinen
On Thu, 29 Aug 2024, Reinette Chatre wrote: > By default the MBM and MBA tests use the "fill_buf" benchmark to > read from a buffer with the goal to measure the memory bandwidth > generated by this buffer access. > > Care should be taken when sizing the buffer used by the "fill_buf" > benchmark.

Re: [PATCH 3/6] selftests/resctrl: Simplify benchmark parameter passing

2024-08-30 Thread Ilpo Järvinen
On Thu, 29 Aug 2024, Reinette Chatre wrote: > The benchmark used during the CMT, MBM, and MBA tests can be provided by > the user via (-b) parameter to the tests, if not provided the default > "fill_buf" benchmark is used. > > The "fill_buf" benchmark requires parameters and these are managed as

Re: [PATCH 2/6] selftests/resctrl: Ensure measurements skip initialization of default benchmark

2024-08-30 Thread Ilpo Järvinen
On Thu, 29 Aug 2024, Reinette Chatre wrote: > The CMT, MBA, and MBM tests rely on the resctrl_val() wrapper to > start and run a benchmark while providing test specific flows > via callbacks to do test specific configuration and measurements. > > At a high level, the resctrl_val() flow is: >

Re: [PATCH 1/6] selftests/resctrl: Fix sparse warnings

2024-08-30 Thread Ilpo Järvinen
ols/testing/selftests/resctrl/resctrl_val.c:81:6: warning: symbol > 'get_event_and_umask' was not declared. Should it be static? > > Signed-off-by: Reinette Chatre Reviewed-by: Ilpo Järvinen -- i.

[PATCH v3 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-29 Thread Ilpo Järvinen
oted down the reason for void casts in the stub Ilpo Järvinen (3): selftests/resctrl: Generalize non-contiguous CAT check selftests/resctrl: Always initialize ecx to avoid build warnings kselftest: Provide __cpuid_count() stub on non-x86 archs tools/testing/selftests/kselftest.h

[PATCH v3 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-29 Thread Ilpo Järvinen
uire it using uname -m. Provide a stub for __cpuid_count() if HAVE_CPUID is not present to allow build to succeed. The stub casts its arguments to void to avoid causing "unused variable" or "set but not used" warnings. Fixes: ae638551ab64 ("selftests/resctrl: Add non-contiguous

[PATCH v3 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings

2024-08-29 Thread Ilpo Järvinen
To avoid warnings when __cpuid_count() is an empty stub, always initialize ecx because it is used in the return statement. Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/resctrl/cat_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 1/3] selftests/resctrl: Generalize non-contiguous CAT check

2024-08-29 Thread Ilpo Järvinen
vendors. Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/resctrl/cat_test.c | 26 +- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl

Re: [PATCH v2 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-26 Thread Ilpo Järvinen
On Fri, 23 Aug 2024, Reinette Chatre wrote: > On 8/23/24 3:47 AM, Ilpo Järvinen wrote: > > On Thu, 22 Aug 2024, Reinette Chatre wrote: > > > On 8/22/24 1:11 AM, Ilpo Järvinen wrote: > > > > Building resctrl selftest fails on ARM because it uses __cpuid_count() >

Re: [PATCH v2 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-23 Thread Ilpo Järvinen
On Thu, 22 Aug 2024, Reinette Chatre wrote: > Hi Ilpo, > > On 8/22/24 1:11 AM, Ilpo Järvinen wrote: > > Building resctrl selftest fails on ARM because it uses __cpuid_count() > > that fails the build with error: > > > >CC resctrl_tests >

[PATCH v2 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-22 Thread Ilpo Järvinen
o succeed. The stub casts its arguments to void to avoid causing variable unused warnings. Fixes: ae638551ab64 ("selftests/resctrl: Add non-contiguous CBMs CAT test") Reported-by: Muhammad Usama Anjum Signed-off-by: Ilpo Järvinen Tested-by: Muhammad Usama Anjum Reviewed-by: Muhammad Usama

[PATCH v2 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings

2024-08-22 Thread Ilpo Järvinen
To avoid warnings when __cpuid_count() is an empty stub, always initialize ecx because it is used in the return statement. Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/resctrl/cat_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 1/3] selftests/resctrl: Generalize non-contiguous CAT check

2024-08-22 Thread Ilpo Järvinen
vendors. Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/resctrl/cat_test.c | 26 +- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl

[PATCH v2 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-22 Thread Ilpo Järvinen
ommon level rather than e.g. disabling build for resctrl selftest for archs lacking resctrl support. v2: - Removed RFC from the last patch & added Fixes and tags - Fixed the error message's line splits - Noted down the reason for void casts in the stub Ilpo Järvinen (3): selftests/resct

Re: [PATCH 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-22 Thread Ilpo Järvinen
On Thu, 22 Aug 2024, Muhammad Usama Anjum wrote: > On 8/21/24 11:30 AM, Shuah Khan wrote: > > On 8/13/24 04:45, Ilpo Järvinen wrote: > >> First, generalize resctrl selftest non-contiguous CAT check to not > >> assume non-AMD vendor implies Intel. Second, improve ksel

[RFC PATCH 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-13 Thread Ilpo Järvinen
id_count' 303 | __cpuid_count(0x10, 2, eax, ebx, ecx, edx); | ^ The resctrl selftest would run that code only on Intel CPUs but as is, the code cannot be build at all. Provide an empty stub for __cpuid_count() if it is not supported to allow bu

[PATCH 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings

2024-08-13 Thread Ilpo Järvinen
To avoid warnings when __cpuid_count() is an empty stub, always initialize ecx because it is used in the return statement. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cat_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests

[PATCH 1/3] selftests/resctrl: Generalize non-contiguous CAT check

2024-08-13 Thread Ilpo Järvinen
vendors. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cat_test.c | 26 +- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c index 742782438ca3

[PATCH 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-13 Thread Ilpo Järvinen
some work on which symbol the conditional in kselftest.h is implemented. I could not find any pre-existing one that could be used. Perhaps somebody who's more familiar with the kselftest build system has a better suggestion on which symbol the logic should be based at? Ilpo Järvin

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-13 Thread Ilpo Järvinen
On Mon, 12 Aug 2024, Reinette Chatre wrote: > On 8/12/24 3:49 PM, Shuah Khan wrote: > > On 8/9/24 02:45, Ilpo Järvinen wrote: > > > Adding Maciej. > > > > > > On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > > > > On 8/9/24 12:23 PM, Ilpo Järvin

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-09 Thread Ilpo Järvinen
Adding Maciej. On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > On 8/9/24 12:23 PM, Ilpo Järvinen wrote: > > On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > > > >> This test doesn't have support for other architectures. Altough resctrl > >

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-09 Thread Ilpo Järvinen
On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > This test doesn't have support for other architectures. Altough resctrl > is supported on x86 and ARM, but arch_supports_noncont_cat() shows that > only x86 for AMD and Intel are supported by the test. One does not follow from the other. arch_supp

Re: [PATCH v3] selftests/resctrl: Fix non-contiguous CBM for AMD

2024-06-12 Thread Ilpo Järvinen
ned-off-by: Babu Moger > Reviewed-by: Reinette Chatre Thanks. Reviewed-by: Ilpo Järvinen -- i. > --- > v3: Reworked changelong. > > v2: Moved the non-contiguous CBM verification to a new function > arch_supports_noncont_cat. > > v1: This was part of the series

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Ilpo Järvinen
On Mon, 10 Jun 2024, Moger, Babu wrote: > On 6/10/24 11:20, Ilpo Järvinen wrote: > > On Mon, 10 Jun 2024, Babu Moger wrote: > > > >> The selftest noncont_cat_run_test fails on AMD with the warnings. Reason > > > > noncont_cat_run_test() > > I want t

Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-10 Thread Ilpo Järvinen
On Mon, 10 Jun 2024, Babu Moger wrote: > The selftest noncont_cat_run_test fails on AMD with the warnings. Reason noncont_cat_run_test() (In general, use () when refering to a function, same thing in the shortlog). "the warnings" sounds like I should know about what warning it fails with but t

[PATCH v7 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-06-10 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() resctrl_val parameter and resctrl_val member from the struct resctrl_val_param that are not used anymore. Similarly, remove the test name constants that are no longer used. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing

[PATCH v7 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-06-10 Thread Ilpo Järvinen
: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v7: - Fix separator to use 3 dashes v4: - New patch --- tools/testing/selftests/resctrl/cmt_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing

[PATCH v7 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-06-10 Thread Ilpo Järvinen
est initialization. Remove also unused branches to setup paths and the related #defines for CMT test. While touching kerneldoc, make the adjacent line consistent with the newly added form (callback vs call back). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: -

[PATCH v7 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-06-10 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reine

[PATCH v7 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-06-10 Thread Ilpo Järvinen
. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v6: - Language tweak into kerneldoc - Removed stale paragraph from commit message v5: - Return 0 if grp_name is null (restore earlier behavior) - Move the root group note from comment into kerneldoc v3: - Removed

[PATCH v7 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-06-10 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl

[PATCH v7 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-06-10 Thread Ilpo Järvinen
esctrl_val(). - Pass bw_report to measure_mem_bw() from ->measure() hook because resctrl_val() no longer needs bw_report for anything. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Use imperative tone in commit message v2: - Rebased on top of ne

[PATCH v7 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-06-10 Thread Ilpo Järvinen
ion which simplifies what resctrl_val() has to do. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v2: - spaces -> tabs --- tools/testing/selftests/resctrl/cmt_test.c| 8 tools/testing/selftests/resctrl/mba_test.c| 9 - tools/t

[PATCH v7 05/16] selftests/resctrl: Use correct type for pids

2024-06-10 Thread Ilpo Järvinen
for that would complicate the code unnecessarily, the selftest code does not need to be portable). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Cast to int before printing to match with %d. --- tools/testing/selftests/resctrl/cache.c | 10

[PATCH v7 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-06-10 Thread Ilpo Järvinen
selftest. Remove all unused branches opening other files to simplify the code. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v4: - Remove also MBM .mongrp setup v3: - New patch --- tools/testing/selftests/resctrl/mbm_test.c

[PATCH v7 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-06-10 Thread Ilpo Järvinen
measure_vals() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Typo fix to commit message - Consistent caps in kerneldoc

[PATCH v7 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-06-10 Thread Ilpo Järvinen
) and measure_llc_resctrl() more similar to each other. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h | 9 tools/testing/selftests/resctrl/resctrl_val.c | 23 --- 2 files changed, 15 in

[PATCH v7 04/16] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-06-10 Thread Ilpo Järvinen
determining the domain ID into resctrl_val() and pass the domain ID instead of CPU ID to initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl(). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl_val.c | 33

[PATCH v7 03/16] selftests/resctrl: Make "bandwidth" consistent in comments & prints

2024-06-10 Thread Ilpo Järvinen
Resctrl selftests refer to "bandwidth" currently in two other forms in the code ("B/W" and "band width"). Use "bandwidth" consistently everywhere. While at it, fix also one "over flow" -> "overflow" on a line that is touched by

[PATCH v7 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-06-10 Thread Ilpo Järvinen
improve measurement accuracy. For the second read after rewind() to return a fresh value, also newline has to be consumed by the fscanf(). Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v7: - Truly use "bound to", not

[PATCH v7 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops

2024-06-10 Thread Ilpo Järvinen
. Fixes: 7f4d257e3a2a ("selftests/resctrl: Add callback to start a benchmark") Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v4: - Merge with the fix close patch - Add loop to reset imc_counters_config fds to -1

[PATCH v7 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-06-10 Thread Ilpo Järvinen
idth" consistent in comments & prints - New patch: Simplify mem bandwidth file code - Remove wrong comment - Changed grp_name check to return -1 on fail (internal sanity check) v2: - Resolved conflicts with kselftest/next - Spaces -> tabs correction Ilpo Järvinen (16): selftests/r

Re: [PATCH v6 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-06-10 Thread Ilpo Järvinen
On Fri, 7 Jun 2024, Reinette Chatre wrote: > On 6/7/24 5:53 AM, Ilpo Järvinen wrote: > > For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs > > the measurement over a duration of sleep(1) call. The memory bandwidth > > numbers from IMC are derived ov

[PATCH v6 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-06-07 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() resctrl_val parameter and resctrl_val member from the struct resctrl_val_param that are not used anymore. Similarly, remove the test name constants that are no longer used. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing

[PATCH v6 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-06-07 Thread Ilpo Järvinen
: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre -- v4: - New patch --- tools/testing/selftests/resctrl/cmt_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools

[PATCH v6 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-06-07 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reine

[PATCH v6 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-06-07 Thread Ilpo Järvinen
. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v6: - Language tweak into kerneldoc - Removed stale paragraph from commit message v5: - Return 0 if grp_name is null (restore earlier behavior) - Move the root group note from comment into kerneldoc v3: - Removed

[PATCH v6 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-06-07 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl

[PATCH v6 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-06-07 Thread Ilpo Järvinen
esctrl_val(). - Pass bw_report to measure_mem_bw() from ->measure() hook because resctrl_val() no longer needs bw_report for anything. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Use imperative tone in commit message v2: - Rebased on top of ne

[PATCH v6 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-06-07 Thread Ilpo Järvinen
est initialization. Remove also unused branches to setup paths and the related #defines for CMT test. While touching kerneldoc, make the adjacent line consistent with the newly added form (callback vs call back). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: -

[PATCH v6 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-06-07 Thread Ilpo Järvinen
ion which simplifies what resctrl_val() has to do. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v2: - spaces -> tabs --- tools/testing/selftests/resctrl/cmt_test.c| 8 tools/testing/selftests/resctrl/mba_test.c| 9 - tools/t

[PATCH v6 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-06-07 Thread Ilpo Järvinen
selftest. Remove all unused branches opening other files to simplify the code. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v4: - Remove also MBM .mongrp setup v3: - New patch --- tools/testing/selftests/resctrl/mbm_test.c

[PATCH v6 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-06-07 Thread Ilpo Järvinen
measure_vals() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Typo fix to commit message - Consistent caps in kerneldoc

[PATCH v6 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-06-07 Thread Ilpo Järvinen
) and measure_llc_resctrl() more similar to each other. Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h | 9 tools/testing/selftests/resctrl/resctrl_val.c | 23 --- 2 files changed, 15 in

[PATCH v6 05/16] selftests/resctrl: Use correct type for pids

2024-06-07 Thread Ilpo Järvinen
for that would complicate the code unnecessarily, the selftest code does not need to be portable). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v5: - Cast to int before printing to match with %d. --- tools/testing/selftests/resctrl/cache.c | 10

[PATCH v6 04/16] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-06-07 Thread Ilpo Järvinen
determining the domain ID into resctrl_val() and pass the domain ID instead of CPU ID to initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl(). Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl_val.c | 33

[PATCH v6 03/16] selftests/resctrl: Make "bandwidth" consistent in comments & prints

2024-06-07 Thread Ilpo Järvinen
Resctrl selftests refer to "bandwidth" currently in two other forms in the code ("B/W" and "band width"). Use "bandwidth" consistently everywhere. While at it, fix also one "over flow" -> "overflow" on a line that is touched by

[PATCH v6 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-06-07 Thread Ilpo Järvinen
improve measurement accuracy. For the second read after rewind() to return a fresh value, also newline has to be consumed by the fscanf(). Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger --- v6: - Adjust closing/rollback of the IMC perf - Move the comment in

[PATCH v6 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops

2024-06-07 Thread Ilpo Järvinen
. Fixes: 7f4d257e3a2a ("selftests/resctrl: Add callback to start a benchmark") Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Tested-by: Babu Moger Reviewed-by: Reinette Chatre --- v4: - Merge with the fix close patch - Add loop to reset imc_counters_config fds to -1

[PATCH v6 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-06-07 Thread Ilpo Järvinen
th file code - Remove wrong comment - Changed grp_name check to return -1 on fail (internal sanity check) v2: - Resolved conflicts with kselftest/next - Spaces -> tabs correction Ilpo Järvinen (16): selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops selftests

Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-07 Thread Ilpo Järvinen
gt;> 3) & 1)) { > + if ((get_vendor() == ARCH_INTEL) && sparse_masks != ((ecx >> 3) & 1)) { > ksft_print_msg("CPUID output doesn't match 'sparse_masks' file > content!\n"); > return 1; > } > Reviewed-by: Ilpo Järvinen -- i.

Re: [PATCH v5 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-06-03 Thread Ilpo Järvinen
On Fri, 31 May 2024, Reinette Chatre wrote: > On 5/31/24 6:11 AM, Ilpo Järvinen wrote: > > For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs > > the measurement over a duration of sleep(1) call. The memory bandwidth > > numbers from IMC are derived ov

Re: [PATCH v5 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-06-02 Thread Ilpo Järvinen
On Fri, 31 May 2024, Reinette Chatre wrote: > On 5/31/24 6:11 AM, Ilpo Järvinen wrote: > > The struct resctrl_val_param has control and monitor groups as char > > arrays but they are not supposed to be mutated within resctrl_val(). > > > > Convert the ctrlgrp a

[PATCH v5 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-05-31 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() resctrl_val parameter and resctrl_val member from the struct resctrl_val_param that are not used anymore. Similarly, remove the test name constants that are no longer used. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cat_test.c| 5 +-- tools/testing

[PATCH v5 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-05-31 Thread Ilpo Järvinen
: Reinette Chatre Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre -- v4: - New patch --- tools/testing/selftests/resctrl/cmt_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl

[PATCH v5 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-05-31 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing

[PATCH v5 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-05-31 Thread Ilpo Järvinen
h the current selftests (ctrlgrp is never NULL). Signed-off-by: Ilpo Järvinen --- v5: - Return 0 if grp_name is null (restore earlier behavior) - Move the root group note from comment into kerneldoc v3: - Removed wrong comment - Changed grp_name check to return -1 on fail (internal sanity

[PATCH v5 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-05-31 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h | 7 --- tools

[PATCH v5 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-05-31 Thread Ilpo Järvinen
esctrl_val(). - Pass bw_report to measure_mem_bw() from ->measure() hook because resctrl_val() no longer needs bw_report for anything. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v5: - Use imperative tone in commit message v2: - Rebased on top of next to resolve conflict

[PATCH v5 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-05-31 Thread Ilpo Järvinen
est initialization. Remove also unused branches to setup paths and the related #defines for CMT test. While touching kerneldoc, make the adjacent line consistent with the newly added form (callback vs call back). Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v5: - Use consistent formatt

[PATCH v5 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-05-31 Thread Ilpo Järvinen
ion which simplifies what resctrl_val() has to do. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v2: - spaces -> tabs --- tools/testing/selftests/resctrl/cmt_test.c| 8 tools/testing/selftests/resctrl/mba_test.c| 9 - tools/testing/selftests/r

[PATCH v5 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-05-31 Thread Ilpo Järvinen
selftest. Remove all unused branches opening other files to simplify the code. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v4: - Remove also MBM .mongrp setup v3: - New patch --- tools/testing/selftests/resctrl/mbm_test.c| 1 - tools/testing

[PATCH v5 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-05-31 Thread Ilpo Järvinen
measure_vals() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v5: - Typo fix to commit message - Consistent caps in kerneldoc --- tools/testing

[PATCH v5 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-05-31 Thread Ilpo Järvinen
) and measure_llc_resctrl() more similar to each other. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h | 9 tools/testing/selftests/resctrl/resctrl_val.c | 23 --- 2 files changed, 15 insertions(+), 17

[PATCH v5 05/16] selftests/resctrl: Use correct type for pids

2024-05-31 Thread Ilpo Järvinen
for that would complicate the code unnecessarily, the selftest code does not need to be portable). Signed-off-by: Ilpo Järvinen --- v5: - Cast to int before printing to match with %d. --- tools/testing/selftests/resctrl/cache.c | 10 +- tools/testing/selftests/resctrl/resctrl.h

[PATCH v5 04/16] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-05-31 Thread Ilpo Järvinen
determining the domain ID into resctrl_val() and pass the domain ID instead of CPU ID to initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl(). Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl_val.c | 33 --- 1 file changed

[PATCH v5 03/16] selftests/resctrl: Make "bandwidth" consistent in comments & prints

2024-05-31 Thread Ilpo Järvinen
Resctrl selftests refer to "bandwidth" currently in two other forms in the code ("B/W" and "band width"). Use "bandwidth" consistently everywhere. While at it, fix also one "over flow" -> "overflow" on a line that is touched by

[PATCH v5 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-31 Thread Ilpo Järvinen
improve measurement accuracy. For the second read after rewind() to return a fresh value, also newline has to be consumed by the fscanf(). Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen --- v5: - Open mem bw file once and use rewind() - Read \n from the mem bw file to allow rewind to

[PATCH v5 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops

2024-05-31 Thread Ilpo Järvinen
. Fixes: 7f4d257e3a2a ("selftests/resctrl: Add callback to start a benchmark") Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v4: - Merge with the fix close patch - Add loop to reset imc_counters_config fds to -1 to be able know which ne

[PATCH v5 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-05-31 Thread Ilpo Järvinen
sanity check) v2: - Resolved conflicts with kselftest/next - Spaces -> tabs correction Ilpo Järvinen (16): selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only selftests/resctrl

Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-31 Thread Ilpo Järvinen
On Thu, 30 May 2024, Reinette Chatre wrote: > Hi Ilpo, > > On 5/30/24 4:11 AM, Ilpo Järvinen wrote: > > On Tue, 28 May 2024, Reinette Chatre wrote: > > > On 5/28/24 3:19 AM, Ilpo Järvinen wrote: > > > > On Fri, 24 May 2024, Ilpo Järvinen wrote: > >

Re: [PATCH v4 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-05-30 Thread Ilpo Järvinen
On Wed, 29 May 2024, Reinette Chatre wrote: > On 5/20/24 5:30 AM, Ilpo Järvinen wrote: > > Nothing during MBA test uses mongrp even if it has been defined ever > > since the introduction of the MBA test in the commit 01fee6b4d1f9 > > ("selftests/resctrl: Add MBA test&quo

Re: [PATCH v4 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-05-30 Thread Ilpo Järvinen
On Wed, 29 May 2024, Reinette Chatre wrote: > Hi Ilpo, > > On 5/20/24 5:30 AM, Ilpo Järvinen wrote: > > The struct resctrl_val_param has control and monitor groups as char > > arrays but they are not supposed to be mutated within resctrl_val(). > > > > Convert

Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-30 Thread Ilpo Järvinen
On Tue, 28 May 2024, Reinette Chatre wrote: > On 5/28/24 3:19 AM, Ilpo Järvinen wrote: > > On Fri, 24 May 2024, Ilpo Järvinen wrote: > > > On Fri, 24 May 2024, Reinette Chatre wrote: > > > > On 5/24/24 12:57 AM, Ilpo Järvinen wrote: > > > > &g

Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-28 Thread Ilpo Järvinen
On Fri, 24 May 2024, Ilpo Järvinen wrote: > On Fri, 24 May 2024, Reinette Chatre wrote: > > On 5/24/24 12:57 AM, Ilpo Järvinen wrote: > > > On Thu, 23 May 2024, Reinette Chatre wrote: > > > > On 5/20/24 5:30 AM, Ilpo Järvinen wrote: > > > > > For MBM/M

Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-24 Thread Ilpo Järvinen
On Fri, 24 May 2024, Reinette Chatre wrote: > On 5/24/24 12:57 AM, Ilpo Järvinen wrote: > > On Thu, 23 May 2024, Reinette Chatre wrote: > > > On 5/20/24 5:30 AM, Ilpo Järvinen wrote: > > > > For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs

Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-24 Thread Ilpo Järvinen
On Thu, 23 May 2024, Reinette Chatre wrote: > On 5/20/24 5:30 AM, Ilpo Järvinen wrote: > > For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs > > the measurement over a duration of sleep(1) call. The memory bandwidth > > numbers from IMC are derived ov

[PATCH v4 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-05-20 Thread Ilpo Järvinen
user of resctrl_val gone, the parameter and member from the struct resctrl_val_param can removed. Test name constants can also be removed because they are not used anymore. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cat_test.c| 5 +-- tools/testing/selftests/resctrl

[PATCH v4 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-05-20 Thread Ilpo Järvinen
: Reinette Chatre Signed-off-by: Ilpo Järvinen -- v4: - New patch --- tools/testing/selftests/resctrl/cmt_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c index 238f514ba7e6

[PATCH v4 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-05-20 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/mba_test.c | 1

[PATCH v4 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-05-20 Thread Ilpo Järvinen
h the current selftests (ctrlgrp is never NULL). Signed-off-by: Ilpo Järvinen --- v3: - Removed wrong comment - Changed grp_name check to return -1 on fail (internal sanity check) --- tools/testing/selftests/resctrl/resctrl.h | 4 ++-- tools/testing/selftests/resctrl/resctrlfs.c

[PATCH v4 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-05-20 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 7 --- tools/testing/selftests/resctrl

[PATCH v4 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-05-20 Thread Ilpo Järvinen
esctrl_val(). - As resctrl_val() no longer needs bw_report for anything, it can just be passed to measure_mem_bw() by the ->measure() hooks. Signed-off-by: Ilpo Järvinen --- v2: - Rebased on top of next to resolve conflict in resctrl.h --- tools/testing/selftests/resctrl/mba_test.c| 3 +--

[PATCH v4 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-05-20 Thread Ilpo Järvinen
est initialization. Remove also unused branches to setup paths and the related #defines for CMT test. Signed-off-by: Ilpo Järvinen --- v3: - Rename init functions to _init() - Removed tabs intermixed with code - Leave now common mbm bw filename setup into resctrl_val.c --- tools/testing/selftests/resc

[PATCH v4 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-05-20 Thread Ilpo Järvinen
ion which simplifies what resctrl_val() has to do. Signed-off-by: Ilpo Järvinen --- v2: - spaces -> tabs --- tools/testing/selftests/resctrl/cmt_test.c| 8 tools/testing/selftests/resctrl/mba_test.c| 9 - tools/testing/selftests/resctrl/mbm_test.c| 9 -

[PATCH v4 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-05-20 Thread Ilpo Järvinen
selftest. Remove all unused branches opening other files to simplify the code. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen --- v4: - Remove also MBM .mongrp setup v3: - New patch --- tools/testing/selftests/resctrl/mbm_test.c| 1 - tools/testing/selftests/resctrl/resctrl_val.c

[PATCH v4 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-05-20 Thread Ilpo Järvinen
measure_val() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl_val.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff

[PATCH v4 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-05-20 Thread Ilpo Järvinen
nd measure_llc_resctrl() more similar to each other. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 9 tools/testing/selftests/resctrl/resctrl_val.c | 23 --- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/tools/test

[PATCH v4 05/16] selftests/resctrl: Use correct type for pids

2024-05-20 Thread Ilpo Järvinen
A few functions receive PIDs through int arguments. PIDs variables should be of type pid_t, not int. Convert pid arguments from int to pid_t. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cache.c | 6 +++--- tools/testing/selftests/resctrl/resctrl.h | 4 ++-- tools

  1   2   3   4   >