<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/tools/testing/selftests/resctrl/resctrl_val.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/resctrl/resctrl_val.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/resctrl/resctrl_val.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-04-25T23:06:41Z</updated>
<entry>
<title>selftests/resctrl: Kill child process before parent process terminates if SIGTERM is received</title>
<updated>2022-04-25T23:06:41Z</updated>
<author>
<name>Shaopeng Tan</name>
<email>tan.shaopeng@jp.fujitsu.com</email>
</author>
<published>2022-03-23T08:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f54b3278164405fdd4f5f1b53f0d04e34ade27a6'/>
<id>urn:sha1:f54b3278164405fdd4f5f1b53f0d04e34ade27a6</id>
<content type='text'>
In kselftest framework, a sub test is run using the timeout utility
and it will send SIGTERM to the test upon timeout.

In resctrl_tests, a child process is created by fork() to
run benchmark but SIGTERM is not set in sigaction().
If SIGTERM signal is received, the parent process will be killed,
but the child process still exists.

Kill child process before the parent process terminates
if SIGTERM signal is received.

Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Reviewed-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shaopeng Tan &lt;tan.shaopeng@jp.fujitsu.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Fix checking for &lt; 0 for unsigned values</title>
<updated>2021-04-02T19:58:37Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2021-03-17T02:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1205b688c92558a04d8dd4cbc2b213e0fceba5db'/>
<id>urn:sha1:1205b688c92558a04d8dd4cbc2b213e0fceba5db</id>
<content type='text'>
Dan reported following static checker warnings

tools/testing/selftests/resctrl/resctrl_val.c:545 measure_vals()
warn: 'bw_imc' unsigned &lt;= 0

tools/testing/selftests/resctrl/resctrl_val.c:549 measure_vals()
warn: 'bw_resc_end' unsigned &lt;= 0

These warnings are reported because
1. measure_vals() declares 'bw_imc' and 'bw_resc_end' as unsigned long
   variables
2. Return value of get_mem_bw_imc() and get_mem_bw_resctrl() are assigned
   to 'bw_imc' and 'bw_resc_end' respectively
3. The returned values are checked for &lt;= 0 to see if the calls failed

Checking for &lt; 0 for an unsigned value doesn't make any sense.

Fix this issue by changing the implementation of get_mem_bw_imc() and
get_mem_bw_resctrl() such that they now accept reference to a variable
and set the variable appropriately upon success and return 0, else return
&lt; 0 on error.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Tested-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Fix incorrect parsing of iMC counters</title>
<updated>2021-04-02T19:58:31Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2021-03-17T02:22:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d81343b5eedf84be71a4313e8fd073d0c510afcf'/>
<id>urn:sha1:d81343b5eedf84be71a4313e8fd073d0c510afcf</id>
<content type='text'>
iMC (Integrated Memory Controller) counters are usually at
"/sys/bus/event_source/devices/" and are named as "uncore_imc_&lt;n&gt;".
num_of_imcs() function tries to count number of such iMC counters so that
it could appropriately initialize required number of perf_attr structures
that could be used to read these iMC counters.

num_of_imcs() function assumes that all the directories under this path
that start with "uncore_imc" are iMC counters. But, on some systems there
could be directories named as "uncore_imc_free_running" which aren't iMC
counters. Trying to read from such directories will result in "not found
file" errors and MBM/MBA tests will fail.

Hence, fix the logic in num_of_imcs() such that it looks at the first
character after "uncore_imc_" to check if it's a numerical digit or not. If
it's a digit then the directory represents an iMC counter, else, skip the
directory.

Reported-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Tested-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Call kselftest APIs to log test results</title>
<updated>2021-04-02T19:54:08Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2021-03-17T02:22:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ca2f4214f9671dfc08b6c5723188e03574203dc5'/>
<id>urn:sha1:ca2f4214f9671dfc08b6c5723188e03574203dc5</id>
<content type='text'>
Call kselftest APIs instead of using printf() to log test results
for cleaner code and better future extension.

Suggested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Tested-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Rename CQM test as CMT test</title>
<updated>2021-04-02T19:53:54Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2021-03-17T02:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2f320911d9fab38597d2a32d91b4f31165e0c9b4'/>
<id>urn:sha1:2f320911d9fab38597d2a32d91b4f31165e0c9b4</id>
<content type='text'>
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 &lt;reinette.chatre@intel.com&gt;
Tested-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Clean up resctrl features check</title>
<updated>2021-04-02T19:51:36Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2021-03-17T02:22:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2428673638ea28fa93d2a38b1c3e8d70122b00ee'/>
<id>urn:sha1:2428673638ea28fa93d2a38b1c3e8d70122b00ee</id>
<content type='text'>
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 &lt;skhan@linuxfoundation.org&gt;
Tested-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest</title>
<updated>2020-02-11T01:42:57Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2020-01-16T21:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=78941183d1b151317beb37b25690b7d87fe2596d'/>
<id>urn:sha1:78941183d1b151317beb37b25690b7d87fe2596d</id>
<content type='text'>
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 &lt;sai.praneeth.prakhya@intel.com&gt;
Signed-off-by: Sai Praneeth Prakhya &lt;sai.praneeth.prakhya@intel.com&gt;
Co-developed-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Add MBM test</title>
<updated>2020-02-11T01:42:29Z</updated>
<author>
<name>Fenghua Yu</name>
<email>fenghua.yu@intel.com</email>
</author>
<published>2020-01-16T21:32:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ecdbb911f22d6cc5d422571dedf048b889d71417'/>
<id>urn:sha1:ecdbb911f22d6cc5d422571dedf048b889d71417</id>
<content type='text'>
MBM (Memory Bandwidth Monitoring) test is the first implemented selftest.
It starts a stressful memory bandwidth benchmark and assigns the
bandwidth pid in a resctrl monitoring group. Read and compare perf IMC
counter and MBM total bytes for the benchmark. The numbers should be
close enough to pass the test.

Default benchmark is built-in fill_buf. But users can specify their
own benchmark by option "-b".

We can add memory bandwidth monitoring for multiple processes in the
future.

Co-developed-by: Sai Praneeth Prakhya &lt;sai.praneeth.prakhya@intel.com&gt;
Signed-off-by: Sai Praneeth Prakhya &lt;sai.praneeth.prakhya@intel.com&gt;
Co-developed-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Add callback to start a benchmark</title>
<updated>2020-02-11T01:38:28Z</updated>
<author>
<name>Sai Praneeth Prakhya</name>
<email>sai.praneeth.prakhya@intel.com</email>
</author>
<published>2020-01-16T21:32:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7f4d257e3a2a4864268f6f0da7c85ca4f083e643'/>
<id>urn:sha1:7f4d257e3a2a4864268f6f0da7c85ca4f083e643</id>
<content type='text'>
The callback starts a child process and puts the child pid in created
resctrl group with specified memory bandwidth in schemata. The child
starts running benchmark.

Signed-off-by: Sai Praneeth Prakhya &lt;sai.praneeth.prakhya@intel.com&gt;
Co-developed-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Babu Moger &lt;babu.moger@amd.com&gt;
Co-developed-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/resctrl: Read memory bandwidth from perf IMC counter and from resctrl file system</title>
<updated>2020-02-11T01:38:08Z</updated>
<author>
<name>Sai Praneeth Prakhya</name>
<email>sai.praneeth.prakhya@intel.com</email>
</author>
<published>2020-01-16T21:32:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1d3f08687d76c0a80be35bbab6d64b1a8f2730e8'/>
<id>urn:sha1:1d3f08687d76c0a80be35bbab6d64b1a8f2730e8</id>
<content type='text'>
Total memory bandwidth can be monitored from perf IMC counter and from
resctrl file system. Later the two will be compared to verify the total
memory bandwidth read from resctrl is correct.

Signed-off-by: Sai Praneeth Prakhya &lt;sai.praneeth.prakhya@intel.com&gt;
Co-developed-by: Babu Moger &lt;babu.moger@amd.com&gt;
Signed-off-by: Babu Moger &lt;babu.moger@amd.com&gt;
Co-developed-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
