Re: [PATCH RESEND v3 1/2] selftests/resctrl: Fix schemata write error check

2023-09-14 Thread Reinette Chatre
Hi Maciej, On 9/13/2023 11:01 PM, Maciej Wieczór-Retman wrote: > On 2023-09-13 at 11:49:19 -0700, Reinette Chatre wrote: >> On 9/12/2023 10:59 PM, Maciej Wieczór-Retman wrote: >>> On 2023-09-12 at 09:00:28 -0700, Reinette Chatre wrote: >>>> On 9/11/2023 11:32 P

Re: [PATCH 1/5] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-14 Thread Reinette Chatre
Hi Ilpo, On 9/14/2023 10:05 AM, Ilpo Järvinen wrote: > On Thu, 14 Sep 2023, Reinette Chatre wrote: >> On 9/14/2023 3:16 AM, Ilpo Järvinen wrote: >>> On Wed, 13 Sep 2023, Reinette Chatre wrote: >>>> On 9/13/2023 3:01 AM, Ilpo Järvinen wrote: >>>>&g

Re: [PATCH v5 0/8] selftests/resctrl: Rework benchmark command handling

2023-09-26 Thread Reinette Chatre
Hi Shuah, Could you please consider this series for inclusion? Thank you very much Reinette On 9/4/2023 2:53 AM, Ilpo Järvinen wrote: > The benchmark command handling (-b) in resctrl selftests is overly > complicated code. This series turns the benchmark command immutable to > preserve it for a

Re: [PATCH v2 5/6] selftests/resctrl: Fix feature checks

2023-09-26 Thread Reinette Chatre
feature > detection") > Signed-off-by: Ilpo Järvinen > Cc: # selftests/resctrl: Refactor feature check to > use resource and feature name Thank you. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 4/6] selftests/resctrl: Refactor feature check to use resource and feature name

2023-09-26 Thread Reinette Chatre
d it looking like the function is returning a freed > pointer). > > Signed-off-by: Ilpo Järvinen > Cc: # selftests/resctrl: Remove duplicate feature > check from CMT test > Cc: # selftests/resctrl: Move _GNU_SOURCE define > into Makefile Thank you. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 6/6] selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests

2023-09-26 Thread Reinette Chatre
moves the failures due > the frequent outliers. > > Fixes: 06bd03a57f8c ("selftests/resctrl: Fix MBA/MBM results reporting > format") > Cc: > Signed-off-by: Ilpo Järvinen Thank you. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 2/6] selftests/resctrl: Remove duplicate feature check from CMT test

2023-09-26 Thread Reinette Chatre
e check for CMT from cmt_resctrl_val(). > > Signed-off-by: Ilpo Järvinen > Cc: Thank you. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 1/6] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-26 Thread Reinette Chatre
Hi Ilpo, On 9/15/2023 8:44 AM, Ilpo Järvinen wrote: > Unmounting resctrl FS has been moved into the per test functions in > resctrl_tests.c by commit caddc0fbe495 ("selftests/resctrl: Move > resctrl FS mount/umount to higher level"). In case a signal (SIGINT, > SIGTERM, or SIGHUP) is received, the

Re: [PATCH v2 3/6] selftests/resctrl: Move _GNU_SOURCE define into Makefile

2023-09-26 Thread Reinette Chatre
ärvinen > Cc: Thank you. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v4 1/2] selftests/resctrl: Fix schemata write error check

2023-09-27 Thread Reinette Chatre
Hi Maciej, On 9/22/2023 1:10 AM, Maciej Wieczor-Retman wrote: > Writing bitmasks to the schemata can fail when the bitmask doesn't > adhere to constraints defined by what a particular CPU supports. > Some example of constraints are max length or having contiguous bits. > The driver should properly

Re: [PATCH v4 0/2] selftests/resctrl: Bug fix and optimization

2023-09-27 Thread Reinette Chatre
Hi Maciej, On 9/22/2023 1:09 AM, Maciej Wieczor-Retman wrote: > The resctrlfs.c file defines functions that interact with the resctrl FS > while resctrl_val.c file defines functions that perform measurements on > the cache. Run_benchmark() fits logically into the second file before > resctrl_val()

Re: [PATCH v2 1/6] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-28 Thread Reinette Chatre
Hi Ilpo, On 9/28/2023 5:47 AM, Ilpo Järvinen wrote: > On Tue, 26 Sep 2023, Reinette Chatre wrote: >> On 9/15/2023 8:44 AM, Ilpo Järvinen wrote: ... >>> + >>> +static void run_mbm_test(const char * const *benchmark_cmd, int cpu_no) >>> +{ >>> + in

Re: [PATCH v4 1/2] selftests/resctrl: Fix schemata write error check

2023-09-28 Thread Reinette Chatre
Hi Maciej, On 9/27/2023 11:46 PM, Maciej Wieczór-Retman wrote: > On 2023-09-27 at 15:15:06 -0700, Reinette Chatre wrote: >> On 9/22/2023 1:10 AM, Maciej Wieczor-Retman wrote: >>> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c >>> b/tools/testing/selftests/re

Re: [PATCH v3 1/7] selftests/resctrl: Fix uninitialized .sa_flags

2023-09-29 Thread Reinette Chatre
en declaring it. > > Fixes: 73c55fa5ab55 (selftests/resctrl: Commonize the signal handler > register/unregister for all tests) Please place the title line in quotes (checkpatch warning). > Suggested-by: Reinette Chatre > Signed-off-by: Ilpo Järvinen > Cc: > --- > tools/test

Re: [PATCH v3 2/7] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-29 Thread Reinette Chatre
return res; > + } > + return 0; > +} > + > +static void test_cleanup() Please change to test_cleanup(void) (checkpatch error). > +{ > + umount_resctrlfs(); > + signal_handler_unregister(); > +} > + With the above two reports addressed you can add: Reviewed-by: Reinette Chatre Thank you. Reinette

Re: [PATCH v5 1/2] selftests/resctrl: Fix schemata write error check

2023-09-29 Thread Reinette Chatre
Hi Maciej, On 9/29/2023 1:21 AM, Maciej Wieczor-Retman wrote: ... > diff --git a/tools/testing/selftests/resctrl/resctrlfs.c > b/tools/testing/selftests/resctrl/resctrlfs.c > index 3a8111362d26..342a3dbcdbb6 100644 > --- a/tools/testing/selftests/resctrl/resctrlfs.c > +++ b/tools/testing/selftes

Re: [PATCH v3 1/8] selftests: Add printf attribute to ksefltest prints

2023-09-29 Thread Reinette Chatre
matted printing with > variadic arguments. > > Reviewed-by: Ilpo Järvinen > Signed-off-by: Maciej Wieczor-Retman With typo fixed: Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 8/8] selftests/resctrl: Fix wrong format specifier

2023-09-29 Thread Reinette Chatre
Järvinen > Signed-off-by: Maciej Wieczor-Retman > --- Thank you very much for this cleanup. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v4 1/7] selftests/resctrl: Fix uninitialized .sa_flags

2023-10-02 Thread Reinette Chatre
laring it. Also add the > initialization to signal_handler_register() even if there are no know > bugs in there because correctness is then obvious from the code itself. > > Fixes: 73c55fa5ab55 ("selftests/resctrl: Commonize the signal handler > register/unregister for all test

Re: [PATCH v4 0/7] selftests/resctrl: Fixes to failing tests

2023-10-02 Thread Reinette Chatre
On 10/2/2023 4:31 AM, Ilpo Järvinen wrote: > On Mon, 2 Oct 2023, Ilpo Järvinen wrote: > >> Fix four issues with resctrl selftests. >> >> The signal handling fix became necessary after the mount/umount fixes >> and the uninitialized member bug was discovered during the review. >> >> The other tw

Re: [PATCH v2 1/6] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-10-04 Thread Reinette Chatre
Hi Shaopeng, On 9/28/2023 1:10 AM, Shaopeng Tan (Fujitsu) wrote: >> On 9/15/2023 8:44 AM, Ilpo Järvinen wrote: ... >>> +static void run_mbm_test(const char * const *benchmark_cmd, int >>> +cpu_no) { >>> + int res; >>> + >>> + ksft_print_msg("Starting MBM BW change ...\n"); >>> + >>> + if (

Re: [PATCH v6 1/2] selftests/resctrl: Fix schemata write error check

2023-10-09 Thread Reinette Chatre
close(fd); > ret = -1; > > goto out; > } > - fclose(fp); > + close(fd); > + schema[schema_len - 1] = 0; > > out: > ksft_print_msg("Write schema \"%s\" to resctrl FS%s%s\n", As changelog states, the newline is removed from schema to ensure it is printed correctly. Note that this is not done when an error is encountered during open() or write() so when an error is encountered in these places then the print does not look as intended. I think a new goto label inserted just before the newline removal should be sufficient, with the open() and write() error paths jumping to it. With that addressed: Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v6 0/8] Add printf attribute to kselftest functions

2023-10-13 Thread Reinette Chatre
On 10/13/2023 2:03 PM, Shuah wrote: > Applied this series and the following three - all 25 patches are > in linux-kselftest next for Linux 6.7-rc1. > > [1] > https://lore.kernel.org/all/cover.1696932728.git.maciej.wieczor-ret...@intel.com/ > [2] > https://lore.kernel.org/all/20231002094813.66

Re: [PATCH 1/1] selftests/resctrl: Don't fail MBM test when schemata doesn't support MB:x=x line

2023-10-17 Thread Reinette Chatre
s == 0) && validate_resctrl_feature_request("MB", > NULL)) > ret = write_schemata(p->ctrlgrp, "100", p->cpu_no, > p->resctrl_val); > Thank you for catching this. Could you please ensure that this patch passes a "checkpatch.pl --strict" check? With that addressed: Reviewed-by: Reinette Chatre Reinette

Re: [PATCH 07/24] selftests/resctrl: Split measure_cache_vals() function

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > The measure_cache_vals() function does a different thing depending on No need to say "function" when using "()". The above can just be: "measure_cache_vals() does a different ..." > the test case that called it: > - For CAT, it measures LL

Re: [PATCH 09/24] selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > Perf counters are __u64 but the code converts them to unsigned long > before printing them out. > > Remove unnecessary type conversion and the potential loss of meaningful > bits due to different sizes of types. This motivation is not clear

Re: [PATCH 10/24] selftests/resctrl: Remove nested calls in perf event handling

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > Perf event handling has functions that are the sole caller of another > perf event handling related function: > - reset_enable_llc_perf() calls perf_event_open_llc_miss() > - reset_enable_llc_perf() calls ioctl_perf_event_ioc_reset_enable(

Re: [PATCH 17/24] selftests/resctrl: Create struct for input parameter

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > diff --git a/tools/testing/selftests/resctrl/mba_test.c > b/tools/testing/selftests/resctrl/mba_test.c > index d3bf4368341e..5157a3f74fee 100644 > --- a/tools/testing/selftests/resctrl/mba_test.c > +++ b/tools/testing/selftests/resctrl/

Re: [PATCH 03/24] selftests/resctrl: Refactor get_cbm_mask()

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > @@ -229,6 +228,31 @@ int get_cbm_mask(char *cache_type, char *cbm_mask) > return 0; > } > > +/* > + * get_cbm_mask - Get cbm bit mask I know you just copied code here but please keep an eye out for acronyms to be written in cap

Re: [PATCH 05/24] selftests/resctrl: Create cache_size() helper

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > CAT and CMT tests calculate the span size from the n-bits cache > allocation on their own. > > Add cache_size() helper which calculates size of the cache portion for > the given number of bits and use it to replace the existing span > calcula

Re: [PATCH 18/24] selftests/resctrl: Introduce generalized test framework

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > diff --git a/tools/testing/selftests/resctrl/resctrl.h > b/tools/testing/selftests/resctrl/resctrl.h > index ec6efd36f60a..e017adf1390d 100644 > --- a/tools/testing/selftests/resctrl/resctrl.h > +++ b/tools/testing/selftests/resctrl/resct

Re: [PATCH 01/24] selftests/resctrl: Split fill_buf to allow tests finer-grained control

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > MBM, MBA and CMT test cases use run_fill_buf() to loop indefinitely > around the buffer. CAT test case is different and doesn't want to loop > around the buffer continuously. Please do not that the changelog starts by describing issue with ru

Re: [PATCH 24/24] selftests/resctrl: Ignore failures from L2 CAT test with <= 2 bits

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > L2 CAT test with low number of bits tends to occasionally fail because > of what seems random variation. The margin is quite small to begin with > for <= 2 bits in CBM. At times, the result can even become negative. > While it would be possibl

Re: [PATCH 08/24] selftests/resctrl: Split show_cache_info() to test specific and generic parts

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > show_cache_info() calculates results and provides generic cache > information. This makes it hard to alter pass/fail conditions. > > Separate the test specific checks into CAT and CMT test files and > leave only the generic information part i

Re: [PATCH 16/24] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-11-02 Thread Reinette Chatre
he CAT test to keep the test isolated. > > Replace count_bits() with count_contiguous_bits() to get the first bit > position in order to be able to calculate masks based on it. > > This change has been tested with a number of systems from different > generations. Thank you very

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > CAT selftests only cover L3 but some newer CPUs come also with L2 CAT > support. No need to use "new" language. L2 CAT has been available for a long time ... since Apollo Lake. Which systems actually support it is a different topic. This is a

Re: [PATCH 06/24] selftests/resctrl: Exclude shareable bits from schemata in CAT test

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > CAT test doesn't take shareable bits into account, i.e., the test might > be sharing cache with some devices (e.g., graphics). > > Introduce get_mask_no_shareable() and use it to provision an > environment for CAT test where the allocated LLC

Re: [PATCH 05/24] selftests/resctrl: Create cache_size() helper

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 1:53 AM, Ilpo Järvinen wrote: > > Yes, I'm more than happy to rename them. This naming was what you > suggested earlier. (I used cache_alloc_size() or something like that > initially and you were against using "alloc" in the name.) My apologies for giving poor guidance.

Re: [PATCH 16/24] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 3:57 AM, Ilpo Järvinen wrote: > On Thu, 2 Nov 2023, Reinette Chatre wrote: >> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... >>> /* >>> - * Change schemata. Write schemata to specified >>> - * con_mon grp, mon_grp in resctrl FS.

Re: [PATCH 17/24] selftests/resctrl: Create struct for input parameter

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 4:24 AM, Ilpo Järvinen wrote: > On Thu, 2 Nov 2023, Reinette Chatre wrote: >> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: >> >>> diff --git a/tools/testing/selftests/resctrl/mba_test.c >>> b/tools/testing/selftests/resctrl/mba_test.c >

Re: [PATCH 18/24] selftests/resctrl: Introduce generalized test framework

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 2:54 AM, Ilpo Järvinen wrote: > On Thu, 2 Nov 2023, Reinette Chatre wrote: >> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: >> ... >>> diff --git a/tools/testing/selftests/resctrl/resctrl.h >>> b/tools/testing/selftests/resctrl/resctrl.h >

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 3:39 AM, Ilpo Järvinen wrote: > On Thu, 2 Nov 2023, Reinette Chatre wrote: >> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > >>> Add L2 CAT selftest. As measuring L2 misses is not easily available >>> with perf, use L3 accesses as a proxy for

Re: [PATCH 24/24] selftests/resctrl: Ignore failures from L2 CAT test with <= 2 bits

2023-11-03 Thread Reinette Chatre
Hi Ilpo, On 11/3/2023 3:24 AM, Ilpo Järvinen wrote: > On Thu, 2 Nov 2023, Reinette Chatre wrote: >> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: >>> L2 CAT test with low number of bits tends to occasionally fail because >>> of what seems random variation. The margin i

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-06 Thread Reinette Chatre
Hi Ilpo, On 11/6/2023 1:53 AM, Ilpo Järvinen wrote: > On Fri, 3 Nov 2023, Reinette Chatre wrote: >> On 11/3/2023 3:39 AM, Ilpo Järvinen wrote: >>> On Thu, 2 Nov 2023, Reinette Chatre wrote: >>>> On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: >>> >>>&

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-06 Thread Reinette Chatre
Hi Ilpo, On 11/6/2023 9:03 AM, Reinette Chatre wrote: > On 11/6/2023 1:53 AM, Ilpo Järvinen wrote: >> On Fri, 3 Nov 2023, Reinette Chatre wrote: >>> On 11/3/2023 3:39 AM, Ilpo Järvinen wrote: >>>> On Thu, 2 Nov 2023, Reinette Chatre wrote: >>>>&g

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-08 Thread Reinette Chatre
Hi Ilpo, On 11/7/2023 1:33 AM, Ilpo Järvinen wrote: > man perf_event_open() says this: > > "If type is PERF_TYPE_RAW, then a custom "raw" config value is needed. > Most CPUs support events that are not covered by the "generalized" > events. These are implementation defined; see your CPU

Re: [PATCH v2 01/26] selftests/resctrl: Don't use ctrlc_handler() outside signal handling

2023-11-28 Thread Reinette Chatre
> Remove call to ctrlc_handler() from perf_event_open_llc_miss(). As > unmounting resctrlfs and test cleanup are already handled properly > by error rollbacks in the calling functions, no other changes are > necessary. > > Suggested-by: Reinette Chatre > Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 02/26] selftests/resctrl: Split fill_buf to allow tests finer-grained control

2023-11-28 Thread Reinette Chatre
e...\n"); > - return -1; > - } > - The changelog does not motivate the removal of this error message. It seems ok at this point since the only failing functions already print their own error message. Without a motivation of this change it is not clear if it is actually intended. In any case, this looks good. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 03/26] selftests/resctrl: Refactor fill_buf functions

2023-11-28 Thread Reinette Chatre
f' to be > consistent in naming the variables. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 04/26] selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Callers of get_cbm_mask() are required to pass a string into which the > capacity bitmask (CBM) is read. Neither CAT nor CMT tests need the > bitmask as string but just convert it into an unsigned long value. > > Another limitation is that th

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > measure_cache_vals() does a different thing depending on the test case > that called it: > - For CAT, it measures LLC misses through perf. > - For CMT, it measures LLC occupancy through resctrl. > > Split these two functionalities into ow

Re: [PATCH v2 10/26] selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion

2023-11-28 Thread Reinette Chatre
e whole time" Even so, this does not seem quite accurate since not all callers of show_cache_info() and print_results_cache() use __u64. This seems ok but it would be nicer if this was highlighted and not use "whole time". > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 14/26] selftests/resctrl: Convert perf related globals to locals

2023-11-28 Thread Reinette Chatre
tand > by doing it inside cat_val(). > > Make also sizeof()s use safer way to determine the right struct. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 15/26] selftests/resctrl: Move cat_val() to cat_test.c and rename to cat_test()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > The main CAT test function is called cat_val() and resides in cache.c > which is illogical. > > Rename the function to cat_test() and move it into cat_test.c. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 16/26] selftests/resctrl: Open perf fd before start & add error handling

2023-11-28 Thread Reinette Chatre
and only reset and enable the > counter within the test loop. Add error checking to pe_fd ioctl() > calls. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 17/26] selftests/resctrl: Replace file write with volatile variable

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > The fill_buf code prevents compiler optimizating the entire read loop > away by writing the final value of the variable into a file. While it > achieves the goal, writing into a file requires significant amount of > work within the innermost t

Re: [PATCH v2 18/26] selftests/resctrl: Read in less obvious order to defeat prefetch optimizations

2023-11-28 Thread Reinette Chatre
d-off-by: Ilpo Järvinen > --- I am not very comfortable with all the uncertainty involved in this patch. A consolation is that this is surely an improvement. Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 19/26] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-11-28 Thread Reinette Chatre
t used by the CAT test to keep the test isolated. > > Replace count_bits() with count_contiguous_bits() to get the first bit > position in order to be able to calculate masks based on it. > > This change has been tested with a number of systems from different > generations. > >

Re: [PATCH v2 20/26] selftests/resctrl: Create struct for input parameters

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... > > +static void init_user_params(struct user_params *uparams) > +{ > + uparams->cpu = 1; > + uparams->bits = 0; > +} > + > int main(int argc, char **argv) > { > bool mbm_test = true, mba_test = true, cmt_test = true; > -

Re: [PATCH v2 21/26] selftests/resctrl: Introduce generalized test framework

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... > + > +static bool cmt_feature_check(const struct resctrl_test *test) > +{ > + return validate_resctrl_feature_request("L3_MON", "llc_occupancy") && > +validate_resctrl_feature_request("L3", NULL); > +} > + ... > + > +stati

Re: [PATCH v2 22/26] selftests/resctrl: Pass write_schemata() resource instead of test name

2023-11-28 Thread Reinette Chatre
L2, etc.) > * > * Update schemata of a con_mon grp *only* if requested resctrl feature is > * allocation type > * Note above there remains a usage of "feature" that has just been changed to "resource". Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 23/26] selftests/resctrl: Add helper to convert L2/3 to integer

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > "L2"/"L3" conversion to integer is embedded into get_cache_size() > which prevents reuse. > > Create a helper for the cache string to integer conversion to make > it reusable. > > Signed-off-by: Ilpo Järvinen > --- > tools/testing/selftest

Re: [PATCH v2 25/26] selftests/resctrl: Get domain id from cache id

2023-11-28 Thread Reinette Chatre
Taking all the above into account, generalize acquiring the domain id > by taking it from the cache id and do not hard-code the cache level. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 26/26] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > To select test to run -t parameter can be used. However, -t cat > currently maps to L3 CAT test which is confusing after more CAT related > tests are added. > > Allow selecting tests as groups and call L3 CAT test "L3_CAT", "CAT" > group will

Re: [PATCH v1 3/9] x86/resctrl: Add resctrl_mbm_flush_cpu() to collect CPUs' MBM events

2023-12-05 Thread Reinette Chatre
Hi Peter, On 12/1/2023 12:56 PM, Peter Newman wrote: > Hi Reinette, > > On Tue, May 16, 2023 at 5:06 PM Reinette Chatre > wrote: >> On 5/15/2023 7:42 AM, Peter Newman wrote: >>> >>> I used a simple parent-child pipe loop benchmark with the parent in >&

Re: [PATCH v1 3/9] x86/resctrl: Add resctrl_mbm_flush_cpu() to collect CPUs' MBM events

2023-12-05 Thread Reinette Chatre
Hi Peter, On 12/5/2023 4:33 PM, Peter Newman wrote: > On Tue, Dec 5, 2023 at 1:57 PM Reinette Chatre > wrote: >> On 12/1/2023 12:56 PM, Peter Newman wrote: >>> On Tue, May 16, 2023 at 5:06 PM Reinette Chatre >>>> I think it may be optimistic to view this as a re

Re: [PATCH v1 3/9] x86/resctrl: Add resctrl_mbm_flush_cpu() to collect CPUs' MBM events

2023-12-06 Thread Reinette Chatre
Hi Peter, On 12/6/2023 10:38 AM, Peter Newman wrote: > Hi Reinette, > > On Tue, Dec 5, 2023 at 5:47 PM Reinette Chatre > wrote: >> >> On 12/5/2023 4:33 PM, Peter Newman wrote: >>> On Tue, Dec 5, 2023 at 1:57 PM Reinette Chatre >>> wrote: >

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Reinette Chatre
Hi Ilpo, On 12/7/2023 6:32 AM, Ilpo Järvinen wrote: > On Tue, 28 Nov 2023, Reinette Chatre wrote: >> On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... >>> - /* >>> -* Measure llc occupancy from resctrl. >>> -*/ >>> - if (!strncm

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Reinette Chatre
On 12/7/2023 10:33 AM, Ilpo Järvinen wrote: > > I already spent some moments in converting all return error -> return -1, > since all such places do perror() calls anyway (which I also converted to > ksft_perror() or ksft_print_msg() where perror() didn't make any sense) > there's not much a

Re: [PATCH v3 01/29] selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:17 AM, Ilpo Järvinen wrote: > The resctrl selftest code contains a number of perror() calls. Some of > them come with hash character and some don't. The kselftest framework > provides ksft_perror() that is compatible with test output formatting > so it should be used inste

Re: [PATCH v3 02/29] selftests/resctrl: Return -1 instead of errno on error

2023-12-13 Thread Reinette Chatre
e that 0 means the > test was run (either pass or fail). > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 04/29] selftests/resctrl: Change function comments to say < 0 on error

2023-12-13 Thread Reinette Chatre
> While at it, improve cat_val() comment to state that 0 means the test > was run (either pass or fail). > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 07/29] selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > -int get_cbm_mask(char *cache_type, char *cbm_mask) > +static int get_bit_mask(const char *filename, unsigned long *mask) > { > - char cbm_mask_path[1024]; > FILE *fp; > > - if (!cbm_mask) > + if (!filename || !mask) >

Re: [PATCH v3 09/29] selftests/resctrl: Create cache_portion_size() helper

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > +/* > + * cache_portion_size - Calculate the size of a cache portion > + * @cache_size: Total cache size in bytes > + * @portion_mask:Cache portion mask > + * @full_cache_mask: Full Cache Bit Mask (CBM) for the cache > + * > +

Re: [PATCH v3 10/29] selftests/resctrl: Exclude shareable bits from schemata in CAT test

2023-12-13 Thread Reinette Chatre
> available in resctrl.h right away. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 11/29] selftests/resctrl: Split measure_cache_vals()

2023-12-13 Thread Reinette Chatre
off-by: Fenghua Yu > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 20/29] selftests/resctrl: Replace file write with volatile variable

2023-12-13 Thread Reinette Chatre
> Add a volatile 'value_sink' into resctrl_tests.c and make fill_buf to > write into it. As a result, the error handling in fill_buf.c can be > simplified. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 22/29] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-12-13 Thread Reinette Chatre
t used by the CAT test to keep the test isolated. > > Replace count_bits() with count_contiguous_bits() to get the first bit > position in order to be able to calculate masks based on it. > > This change has been tested with a number of systems from different > generations. > > Sugg

Re: [PATCH v3 23/29] selftests/resctrl: Restore the CPU affinity after CAT test

2023-12-13 Thread Reinette Chatre
eturn 0; > } > > +/* > + * taskset_restore - Taskset PID to the earlier CPU affinity > + * @bm_pid: PID that should be reset > + * @old_affinity:The old CPU affinity to restore > + * > + * Return: 0 on success, < 0 on error. > + */ > +int taskset_restore(pid_t bm_pid, cpu_set_t *old_affinity) > +{ > + if (sched_setaffinity(bm_pid, sizeof(*old_affinity), old_affinity)) { > + ksft_perror("Unable to restore taskset"); This message is not clear to me. How about "Unable to restore CPU affinity"? > + return -1; > + } > + > + return 0; > +} > + > /* > * create_grp - Create a group only if one doesn't exist > * @grp_name:Name of the group Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 24/29] selftests/resctrl: Create struct for input parameters

2023-12-13 Thread Reinette Chatre
ily > passed to every test without varying the call signature. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 25/29] selftests/resctrl: Introduce generalized test framework

2023-12-13 Thread Reinette Chatre
ared > between all of the tests. It makes adding new tests easier and removes > the per test if () forests. > > Also add comment to CPU vendor IDs that they must be defined as bits > for a bitmask. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 27/29] selftests/resctrl: Add helper to convert L2/3 to integer

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > "L2"/"L3" conversion to integer is embedded into get_cache_size() > which prevents reuse. > > Create a helper for the cache string to integer conversion to make > it reusable. > > Signed-off-by: Il

Re: [PATCH v3 28/29] selftests/resctrl: Rename resource ID to domain ID

2023-12-13 Thread Reinette Chatre
off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v3 01/29] selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()

2023-12-14 Thread Reinette Chatre
Hi Ilpo, On 12/14/2023 2:12 AM, Ilpo Järvinen wrote: > On Wed, 13 Dec 2023, Reinette Chatre wrote: > >> Hi Ilpo, >> >> On 12/11/2023 4:17 AM, Ilpo Järvinen wrote: >>> The resctrl selftest code contains a number of perror() calls. Some of >>> them co

Re: [PATCH v4 01/29] selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()

2023-12-15 Thread Reinette Chatre
o be able to > differentiate > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v4 07/29] selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()

2023-12-15 Thread Reinette Chatre
e > the bitmask has some bits. > > Also mark cache_type const while at it and remove useless comments that > are related to processing of CBM bits. > > Co-developed-by: Fenghua Yu > Signed-off-by: Fenghua Yu > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v4 00/29] selftests/resctrl: CAT test improvements & generalized test framework

2023-12-15 Thread Reinette Chatre
rnel health and greatly appreciated. All patches in this series should have my reviewed-by tag. For confirmation, for this whole series: Reviewed-by: Reinette Chatre Shuah, could you please consider this series for inclusion at your convenience? Thank you very much. Reinette

Re: [PATCH v4 00/29] selftests/resctrl: CAT test improvements & generalized test framework

2023-12-15 Thread Reinette Chatre
On 12/15/2023 9:45 AM, Reinette Chatre wrote: > Hi Ilpo and Shuah, > > On 12/15/2023 7:04 AM, Ilpo Järvinen wrote: >> Here's v4 series to improve resctrl selftests with generalized test >> framework and rewritten CAT test. >> >> The series contains fo

Re: [PATCH v2 1/4] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > From: Ilpo Järvinen > > To select test to run -t parameter can be used. However, -t cat > currently maps to L3 CAT test which is confusing after more CAT related > tests are added. > > Allow selecting tests as groups and call L3 C

Re: [PATCH v2 2/4] selftests/resctrl: Add helpers for the non-contiguous test

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > The CAT non-contiguous selftests have to read the file responsible for > reporting support of non-contiguous CBMs in Intel CAT. Then the test "in Intel CAT" -> "in kernel (resctrl)" > compares if that information matches what is re

Re: [PATCH v2 3/4] selftests/resctrl: Split validate_resctrl_feature_request()

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > validate_resctrl_feature_request() is used to test both if a resource is > present in the info directory, and if a passed monitoring feature is > present in the mon_features file. There exists a different way to > represent feature s

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > Add tests for both L2 and L3 CAT to verify the return values > generated by writing non-contiguous CBMs don't contradict the > reported non-contiguous support information. > > Use a logical XOR to confirm return value of write_schem

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-09 Thread Reinette Chatre
Hi Ilpo, On 1/9/2024 1:13 AM, Ilpo Järvinen wrote: > On Mon, 8 Jan 2024, Reinette Chatre wrote: > >> Hi Maciej, >> >> On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: >>> Add tests for both L2 and L3 CAT to verify the return values >>> generated by wr

Re: [PATCH v2 3/4] selftests/resctrl: Split validate_resctrl_feature_request()

2024-01-17 Thread Reinette Chatre
Hi Maciej, On 1/17/2024 1:49 AM, Maciej Wieczór-Retman wrote: > On 2024-01-08 at 14:38:45 -0800, Reinette Chatre wrote: >> On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: >>> + >>> + snprintf(res_path, sizeof(res_path), "%s/%s/%s", INFO_PAT

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-17 Thread Reinette Chatre
Hi Maciej, On 1/17/2024 12:26 AM, Maciej Wieczór-Retman wrote: > On 2024-01-08 at 14:42:11 -0800, Reinette Chatre wrote: >> On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: >>> + >>> + if (sparse_masks != ((ecx >> 3) & 1)) >>> +

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-18 Thread Reinette Chatre
Hi Maciej, On 1/18/2024 4:02 AM, Maciej Wieczór-Retman wrote: > On 2024-01-17 at 10:49:06 -0800, Reinette Chatre wrote: >> On 1/17/2024 12:26 AM, Maciej Wieczór-Retman wrote: >>> On 2024-01-08 at 14:42:11 -0800, Reinette Chatre wrote: >>>> On 12/12/2023 6:52 A

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-19 Thread Reinette Chatre
Hi Maciej, On 1/18/2024 11:37 PM, Maciej Wieczór-Retman wrote: > On 2024-01-18 at 09:15:46 -0800, Reinette Chatre wrote: >> On 1/18/2024 4:02 AM, Maciej Wieczór-Retman wrote: >>> On 2024-01-17 at 10:49:06 -0800, Reinette Chatre wrote: >>>> On 1/17/2024 12:26 A

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-22 Thread Reinette Chatre
Hi Maciej, On 1/21/2024 11:56 PM, Maciej Wieczór-Retman wrote: > Hi! > > On 2024-01-19 at 08:39:31 -0800, Reinette Chatre wrote: >> Hi Maciej, >> >> On 1/18/2024 11:37 PM, Maciej Wieczór-Retman wrote: >>> On 2024-01-18 at 09:15:46 -0800, Reinette Chatre wrot

resctrl selftests ready for inclusion

2024-01-22 Thread Reinette Chatre
Hi Shuah, Could you please consider Ilpo's resctrl selftest enhancements [1] for inclusion into kselftest's "next" branch in preparation for the next merge window? Thank you very much. Reinette [1] https://lore.kernel.org/lkml/20231215150515.36983-1-ilpo.jarvi...@linux.intel.com/

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-23 Thread Reinette Chatre
Hi Maciej, On 1/22/2024 11:58 PM, Maciej Wieczór-Retman wrote: > On 2024-01-22 at 08:32:36 -0800, Reinette Chatre wrote: >> Hi Maciej, >> >> On 1/21/2024 11:56 PM, Maciej Wieczór-Retman wrote: >>> Hi! >>> >>> On 2024-01-19 at 08:39:31 -0800, Reine

  1   2   3   >