aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/cache.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-10selftests/resctrl: Correct get_llc_perf() param in function commentIlpo Järvinen1-1/+1
get_llc_perf() function comment refers to cpu_no parameter that does not exist. Correct get_llc_perf() the comment to document llc_perf_miss instead. Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2023-04-10selftests/resctrl: Change initialize_llc_perf() return type to voidIlpo Järvinen1-8/+3
initialize_llc_perf() unconditionally returns 0. initialize_llc_perf() performs only memory initialization, none of which can fail. Change the return type from int to void to accurately reflect that its return value doesn't need to be checked. Remove the error checking from the only callsite. Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2023-04-10selftests/resctrl: Allow ->setup() to return errorsIlpo Järvinen1-1/+3
resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns. Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly. Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest") Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test") Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2021-04-07selftests/resctrl: Change a few printed messagesFenghua Yu1-1/+1
Change a few printed messages to report test progress more clearly. Add a missing "\n" at the end of one printed message. Suggested-by: Shuah Khan <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2021-04-02selftests/resctrl: Share show_cache_info() by CAT and CMT testsFenghua Yu1-0/+42
show_cache_info() functions are defined separately in CAT and CMT tests. But the functions are same for the tests and unnecessary to be defined separately. Share the function by the tests. Suggested-by: Shuah Khan <[email protected]> Tested-by: Babu Moger <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2021-04-02selftests/resctrl: Rename CQM test as CMT testFenghua Yu1-2/+2
CMT (Cache Monitoring Technology) [1] is a H/W feature that reports cache occupancy of a process. resctrl selftest suite has a unit test to test CMT for LLC but the test is named as CQM (Cache Quality Monitoring). Furthermore, the unit test source file is named as cqm_test.c and several functions, variables, comments, preprocessors and statements widely use "cqm" as either suffix or prefix. This rampant misusage of CQM for CMT might confuse someone who is newly looking at resctrl selftests because this feature is named CMT in the Intel Software Developer's Manual. Hence, rename all the occurrences (unit test source file name, functions, variables, comments and preprocessors) of cqm with cmt. [1] Please see Intel SDM, Volume 3, chapter 17 and section 18 for more information on CMT: https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html Suggested-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2021-04-02selftests/resctrl: Clean up resctrl features checkFenghua Yu1-4/+4
Checking resctrl features call strcmp() to compare feature strings (e.g. "mba", "cat" etc). The checkings are error prone and don't have good coding style. Define the constant strings in macros and call strncmp() to solve the potential issues. Suggested-by: Shuah Khan <[email protected]> Tested-by: Babu Moger <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-02-10selftests/resctrl: Add Cache Allocation Technology (CAT) selftestFenghua Yu1-1/+174
Cache Allocation Technology (CAT) selftest allocates a portion of last level cache and starts a benchmark to read each cache line in this portion of cache. Measure the cache misses in perf and the misses should be equal to the number of cache lines in this portion of cache. We don't use CQM to calculate cache usage because some CAT enabled platforms don't have CQM. Co-developed-by: Sai Praneeth Prakhya <[email protected]> Signed-off-by: Sai Praneeth Prakhya <[email protected]> Co-developed-by: Babu Moger <[email protected]> Signed-off-by: Babu Moger <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-02-10selftests/resctrl: Add Cache QoS Monitoring (CQM) selftestFenghua Yu1-0/+99
Cache QoS Monitoring (CQM) selftest starts stressful cache benchmark with specified size of memory to access the cache. Last Level cache occupancy reported by CQM should be close to the size of the memory. Co-developed-by: Sai Praneeth Prakhya <[email protected]> Signed-off-by: Sai Praneeth Prakhya <[email protected]> Co-developed-by: Babu Moger <[email protected]> Signed-off-by: Babu Moger <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>