#
74e76cba |
| 16-Feb-2024 |
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> |
selftests/resctrl: Add resource_info_file_exists()
Feature checking done by resctrl_mon_feature_exists() covers features represented by the feature name presence inside the 'mon_features' file in /s
selftests/resctrl: Add resource_info_file_exists()
Feature checking done by resctrl_mon_feature_exists() covers features represented by the feature name presence inside the 'mon_features' file in /sys/fs/resctrl/info/L3_MON directory. There exists a different way to represent feature support and that is by the presence of 0 or 1 in a single file in the info/resource directory. In this case the filename represents what feature support is being indicated.
Add a generic function to check file presence in the /sys/fs/resctrl/info/<RESOURCE> directory.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Reviewed-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>
show more ...
|
#
00616416 |
| 16-Feb-2024 |
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> |
selftests/resctrl: Split validate_resctrl_feature_request()
validate_resctrl_feature_request() is used to test both if a resource is present in the info directory, and if a passed monitoring feature
selftests/resctrl: Split validate_resctrl_feature_request()
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.
Refactor validate_resctrl_feature_request() into two smaller functions that each accomplish one check to give feature checking more granularity: - Resource directory presence in the /sys/fs/resctrl/info directory. - Feature name presence in the /sys/fs/resctrl/info/<RESOURCE>/mon_features file.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Reviewed-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>
show more ...
|
#
e331ac14 |
| 16-Feb-2024 |
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> |
selftests/resctrl: Add a helper for the non-contiguous test
The CAT non-contiguous selftests have to read the file responsible for reporting support of non-contiguous CBMs in kernel (resctrl). Then
selftests/resctrl: Add a helper for the non-contiguous test
The CAT non-contiguous selftests have to read the file responsible for reporting support of non-contiguous CBMs in kernel (resctrl). Then the test compares if that information matches what is reported by CPUID output.
Add a generic helper function to read an unsigned number from /sys/fs/resctrl/info/<RESOURCE>/<FILE>.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Reviewed-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>
show more ...
|
#
345e8abe |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Get domain id from cache id
Domain id is acquired differently depending on CPU. AMD tests use id from L3 cache, whereas CPUs from other vendors base the id on topology package id.
selftests/resctrl: Get domain id from cache id
Domain id is acquired differently depending on CPU. AMD tests use id from L3 cache, whereas CPUs from other vendors base the id on topology package id. In order to support L2 CAT test, this has to be generalized.
The driver side code seems to get the domain ids from cache ids so the approach used by the AMD branch seems to match the kernel-side code. It will also work with L2 domain IDs as long as the cache level is generalized.
Using the topology id was always fragile due to mismatch with the kernel-side way to acquire the domain id. It got incorrect domain id, e.g., when Cluster-on-Die (CoD) is enabled for CPU (but CoD is not well suited for resctrl in the first place so it has not been a big issue if tests don't work correctly with it).
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 <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
6874f6ed |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Rename resource ID to domain ID
Kernel-side calls the instances of a resource domains.
Change the resource_id naming in the selftest code to domain_id to match the kernel side be
selftests/resctrl: Rename resource ID to domain ID
Kernel-side calls the instances of a resource domains.
Change the resource_id naming in the selftest code to domain_id to match the kernel side better.
Suggested-by: Maciej Wieczór-Retman <maciej.wieczor-retman@intel.com> 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>
show more ...
|
#
e73dda7f |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Add helper to convert L2/3 to integer
"L2"/"L3" conversion to integer is embedded into get_cache_size() which prevents reuse.
Create a helper for the cache string to integer conv
selftests/resctrl: Add helper to convert L2/3 to integer
"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 <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
ca160887 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Pass write_schemata() resource instead of test name
write_schemata() takes the test name as an argument and determines the relevant resource based on the test name. Such mapping f
selftests/resctrl: Pass write_schemata() resource instead of test name
write_schemata() takes the test name as an argument and determines the relevant resource based on the test name. Such mapping from name to resource does not really belong to resctrlfs.c that should provide only generic, test-independent functions.
Pass the resource stored in the test information structure to write_schemata() instead of the test name. The new API is also more flexible as it enables to use write_schemata() for more than one resource within a test.
While touching the sprintf(), move the unnecessary %c that is always '=' directly into the format string.
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>
show more ...
|
#
c603ff5b |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Introduce generalized test framework
Each test currently has a "run test" function in per test file and another resctrl_tests.c. The functions in resctrl_tests.c are almost identi
selftests/resctrl: Introduce generalized test framework
Each test currently has a "run test" function in per test file and another resctrl_tests.c. The functions in resctrl_tests.c are almost identical.
Generalize the one in resctrl_tests.c such that it can be shared 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 <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
6c8cb747 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
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 r
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>
show more ...
|
#
205de6dd |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test
CAT test spawns two processes into two different control groups with exclusive schemata. Both the processes alloc a buffer from memo
selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test
CAT test spawns two processes into two different control groups with exclusive schemata. Both the processes alloc a buffer from memory matching their allocated LLC block size and flush the entire buffer out of caches. Since the processes are reading through the buffer only once during the measurement and initially all the buffer was flushed, the test isn't testing CAT.
Rewrite the CAT test to allocate a buffer sized to half of LLC. Then perform a sequence of tests with different LLC alloc sizes starting from half of the CBM bits down to 1-bit CBM. Flush the buffer before each test and read the buffer twice. Observe the LLC misses on the second read through the buffer. As the allocated LLC block gets smaller and smaller, the LLC misses will become larger and larger giving a strong signal on CAT working properly.
The new CAT test is using only a single process because it relies on measured effect against another run of itself rather than another process adding noise. The rest of the system is set to use the CBM bits not 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.
Suggested-by: Reinette Chatre <reinette.chatre@intel.com> 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>
show more ...
|
#
b6dfac94 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Exclude shareable bits from schemata in CAT test
CAT test doesn't take shareable bits into account, i.e., the test might be sharing cache with some devices (e.g., graphics).
Intr
selftests/resctrl: Exclude shareable bits from schemata in CAT test
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 is isolated better. Excluding shareable_bits may create hole(s) into the cbm_mask, thus add a new helper count_contiguous_bits() to find the longest contiguous set of CBM bits.
create_bit_mask() is needed by an upcoming CAT test rewrite so make it available in resctrl.h right away.
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>
show more ...
|
#
60c2a692 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Mark get_cache_size() cache_type const
get_cache_size() does not modify cache_type so it could be const.
Mark cache_type const so that const char * can be passed to it. This prev
selftests/resctrl: Mark get_cache_size() cache_type const
get_cache_size() does not modify cache_type so it could be const.
Mark cache_type const so that const char * can be passed to it. This prevents warnings once many of the test parameters are marked const.
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>
show more ...
|
#
4b357e2a |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()
Callers of get_cbm_mask() are required to pass a string into which the capacity bitmask (CBM) is read. Neither CAT nor CMT tes
selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()
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 the bit mask reader can only read .../cbm_mask files.
Generalize the bit mask reading function into get_bit_mask() such that it can be used to handle other files besides the .../cbm_mask and handles the unsigned long conversion within get_bit_mask() using fscanf(). Change get_cbm_mask() to use get_bit_mask() and rename it to get_full_cbm() to better indicate what the function does.
Return error from get_full_cbm() if the bitmask is zero for some reason because it makes the code more robust as the selftests naturally assume 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 <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> 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>
show more ...
|
#
34813938 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Change function comments to say < 0 on error
A number function comments state the function return non-zero on failure but in reality they can only return 0 on success and < 0 on e
selftests/resctrl: Change function comments to say < 0 on error
A number function comments state the function return non-zero on failure but in reality they can only return 0 on success and < 0 on error.
Update the comments to say < 0 on error to match the behavior.
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 <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
c90fba60 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Return -1 instead of errno on error
A number of functions in the resctrl selftests return errno. It is problematic because errno is positive which is often counterintuitive. Also,
selftests/resctrl: Return -1 instead of errno on error
A number of functions in the resctrl selftests return errno. It is problematic because errno is positive which is often counterintuitive. Also, every site returning errno prints the error message already with ksft_perror() so there is not much added value in returning the precise error code.
Simply convert all places returning errno to return -1 that is typical userspace error code in case of failures.
While at it, improve resctrl_val() comment to state that 0 means the test was run (either pass or fail).
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>
show more ...
|
#
cc8ff7f5 |
| 15-Dec-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()
The resctrl selftest code contains a number of perror() calls. Some of them come with hash character and some don't. The ksel
selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()
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 instead of adding custom hash signs.
Some perror() calls are too far away from anything that sets error. For those call sites, ksft_print_msg() must be used instead.
Convert perror() to ksft_perror() or ksft_print_msg().
Other related changes: - Remove hash signs - Remove trailing stops & newlines from ksft_perror() - Add terminating newlines for converted ksft_print_msg() - Use consistent capitalization - Small fixes/tweaks to typos & grammar of the messages - Extract error printing out of PARENT_EXIT() to be able to differentiate
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>
show more ...
|
#
508934b5 |
| 10-Oct-2023 |
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> |
selftests/resctrl: Move run_benchmark() to a more fitting file
resctrlfs.c contains mostly functions that interact in some way with resctrl FS entries while functions inside resctrl_val.c deal with
selftests/resctrl: Move run_benchmark() to a more fitting file
resctrlfs.c contains mostly functions that interact in some way with resctrl FS entries while functions inside resctrl_val.c deal with measurements and benchmarking.
run_benchmark() is located in resctrlfs.c even though it's purpose is not interacting with the resctrl FS but to execute cache checking logic.
Move run_benchmark() to resctrl_val.c just before resctrl_val() that makes use of run_benchmark(). Make run_benchmark() static since it's not used between multiple files anymore.
Remove return comment from kernel-doc since the function is type void.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Reviewed-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>
show more ...
|
#
20d96b25 |
| 10-Oct-2023 |
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> |
selftests/resctrl: Fix schemata write error check
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
selftests/resctrl: Fix schemata write error check
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 return errors when any rule concerning bitmask format is broken.
Resctrl FS returns error codes from fprintf() only when fclose() is called. Current error checking scheme allows invalid bitmasks to be written into schemata file and the selftest doesn't notice because the fclose() error code isn't checked.
Substitute fopen(), flose() and fprintf() with open(), close() and write() to avoid error code buffering between fprintf() and fclose().
Remove newline character from the schema string after writing it to the schemata file so it prints correctly before function return.
Pass the string generated with strerror() to the "reason" buffer so the error message is more verbose. Extend "reason" buffer so it can hold longer messages.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Reviewed-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>
show more ...
|
#
d56e5da0 |
| 02-Oct-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Refactor feature check to use resource and feature name
Feature check in validate_resctrl_feature_request() takes in the test name string and maps that to what to check per test.
selftests/resctrl: Refactor feature check to use resource and feature name
Feature check in validate_resctrl_feature_request() takes in the test name string and maps that to what to check per test.
Pass resource and feature names to validate_resctrl_feature_request() directly rather than deriving them from the test name inside the function which makes the feature check easier to extend for new test cases.
Use !! in the return statement to make the boolean conversion more obvious even if it is not strictly necessary from correctness point of view (to avoid it looking like the function is returning a freed pointer).
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Cc: <stable@vger.kernel.org> # selftests/resctrl: Remove duplicate feature check from CMT test Cc: <stable@vger.kernel.org> # selftests/resctrl: Move _GNU_SOURCE define into Makefile Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
7f3c980c |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Don't pass test name to fill_buf
Test name is passed to fill_buf functions so that they can loop around buffer only once. This is required for CAT test case.
To loop around buffe
selftests/resctrl: Don't pass test name to fill_buf
Test name is passed to fill_buf functions so that they can loop around buffer only once. This is required for CAT test case.
To loop around buffer only once, caller doesn't need to let fill_buf know which test case it is. Instead, pass a boolean argument 'once' which makes fill_buf more generic.
As run_benchmark() no longer needs to pass the test name to run_fill_buf(), a few test running functions can be simplified to not write the test name into the default benchmark_cmd. The has_ben argument can also be removed now from those test running functions.
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
326baed2 |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Remove "malloc_and_init_memory" param from run_fill_buf()
run_fill_buf()'s malloc_and_init_memory parameter is always 1. There's also duplicated memory init code for malloc_and_in
selftests/resctrl: Remove "malloc_and_init_memory" param from run_fill_buf()
run_fill_buf()'s malloc_and_init_memory parameter is always 1. There's also duplicated memory init code for malloc_and_init_memory == 0 case in fill_buf() which is unused.
Remove the malloc_and_init_memory parameter and the duplicated mem init code.
While at it, fix also a typo in run_fill_buf() prototype's argument.
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
e24ac428 |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Express span internally in bytes
MBA and MBM tests to use megabytes to represent span. CMT test uses bytes. The difference requires run_benchmark() to size the buffer differently
selftests/resctrl: Express span internally in bytes
MBA and MBM tests to use megabytes to represent span. CMT test uses bytes. The difference requires run_benchmark() to size the buffer differently based on the test name, which in turn requires passing the test name into run_benchmark().
Convert MBA and MBM tests to use span internally in bytes like CMT test to remove the internal inconsistency between the tests. Remove the test dependent buffer sizing from run_benchmark().
This change eliminates one of the reasons why the test name has to be passed around but there are still other users too so the test name passing cannot yet be removed.
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
67a86643 |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Convert span to size_t
Span is defined either as unsigned long or int.
Consistently use size_t everywhere for span as it refers to size of the memory block.
Co-developed-by: Fen
selftests/resctrl: Convert span to size_t
Span is defined either as unsigned long or int.
Consistently use size_t everywhere for span as it refers to size of the memory block.
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
6383851a |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Refactor remount_resctrl(bool mum_resctrlfs) to mount_resctrl()
Mount/umount of the resctrl FS is now paired nicely per test.
Rename remount_resctrl(bool mum_resctrlfs) to mount_
selftests/resctrl: Refactor remount_resctrl(bool mum_resctrlfs) to mount_resctrl()
Mount/umount of the resctrl FS is now paired nicely per test.
Rename remount_resctrl(bool mum_resctrlfs) to mount_resctrl(). Make it unconditionally try to mount the resctrl FS and return error if resctrl FS was mounted already.
While at it, group the mount/umount prototypes in the header.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
#
caddc0fb |
| 17-Jul-2023 |
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> |
selftests/resctrl: Move resctrl FS mount/umount to higher level
A few places currently lack umounting resctrl FS on error paths: - cmt_resctrl_val() has multiple error paths with direct return.
selftests/resctrl: Move resctrl FS mount/umount to higher level
A few places currently lack umounting resctrl FS on error paths: - cmt_resctrl_val() has multiple error paths with direct return. - cat_perf_miss_val() has multiple error paths with direct return. In addition, validate_resctrl_feature_request() is called by run_mbm_test() and run_mba_test(). Neither MBA nor MBM test tries to umount resctrl FS.
Each and every test does require resctrl FS to be present already for feature check. Thus, it makes sense to just mount it on higher level in resctrl_tests.c and properly pair it with umount.
Move resctrl FS (re)mount/unmount into each test function in resctrl_tests.c. Make feature validation to simply check that resctrl FS is mounted.
As there's the final umount in main() before this change, the selftest should not leave resctrl FS behind after the tests even if one of the forementioned paths is taken (thus, no fixes tag).
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|