<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/powerpc/dscr, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-11-07T11:36:30Z</updated>
<entry>
<title>selftests/powerpc: Give all tests 2 minutes timeout</title>
<updated>2024-11-07T11:36:30Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2024-11-06T13:04:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5543d595954eefb3a6faa18a6dc7b1b3d6022052'/>
<id>urn:sha1:5543d595954eefb3a6faa18a6dc7b1b3d6022052</id>
<content type='text'>
Each of the powerpc selftests runs with a timeout of 2 minutes by
default (see tools/testing/selftests/powerpc/harness.c).

But when tests are run with run_kselftest.sh it uses a timeout of 45
seconds, meaning some tests run OK standalone but fail when run with the
test runner.

So tell run_kselftest.sh to give each test 130 seconds, that should
allow the tests to complete, or be killed by the powerpc test harness
after 2 minutes. If for some reason the harness fails, or for the few
tests that don't use the harness, the 130 second timeout should catch
them if they get stuck.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://patch.msgid.link/20241106130453.1741013-2-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc: make sub-folders buildable on their own</title>
<updated>2024-04-29T13:54:42Z</updated>
<author>
<name>Madhavan Srinivasan</name>
<email>maddy@linux.ibm.com</email>
</author>
<published>2024-02-29T09:37:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=108e5e683333615023265a9a73a29d4c2fa16c70'/>
<id>urn:sha1:108e5e683333615023265a9a73a29d4c2fa16c70</id>
<content type='text'>
Build breaks when executing make with run_tests for sub-folders
under powerpc. This is because, CFLAGS and GIT_VERSION macros are
defined in Makefile of toplevel powerpc folder.

  make: Entering directory '/home/maddy/linux/tools/testing/selftests/powerpc/mm'
  gcc     hugetlb_vs_thp_test.c ../harness.c ../utils.c  -o /home/maddy/selftest_output//hugetlb_vs_thp_test
  hugetlb_vs_thp_test.c:6:10: fatal error: utils.h: No such file or directory
      6 | #include "utils.h"
        |          ^~~~~~~~~
  compilation terminated.

Fix this by adding the flags.mk in each sub-folder Makefile. Also remove
the CFLAGS and GIT_VERSION macros from powerpc/ folder Makefile since
the same is definied in flags.mk

Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20240229093711.581230-3-maddy@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/dscr: Restore timeout to DSCR selftests</title>
<updated>2023-04-20T03:21:46Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-04-06T04:33:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ae7312c09014fceb782a92cfb934e973f08b338f'/>
<id>urn:sha1:ae7312c09014fceb782a92cfb934e973f08b338f</id>
<content type='text'>
Reducing the time taken by dscr_sysfs_test.c allows restoring the
default timeout, which was removed in
commit 850507f30c38 ("selftests/powerpc: Turn off timeout setting for
benchmarks, dscr, signal, tm") because that test took too long.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230406043320.125138-8-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/dscr: Speed up DSCR sysfs tests</title>
<updated>2023-04-20T03:21:46Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-04-06T04:33:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c14a9d0a79d4fb83c4e9e8cadc5cb094f41d01d0'/>
<id>urn:sha1:c14a9d0a79d4fb83c4e9e8cadc5cb094f41d01d0</id>
<content type='text'>
This test case is extremely slow, taking around a minute compared to
most of the other DSCR tests taking a second at most. Perf shows most
time is spent by the kernel switching to each CPU it reads in
/sys/devices/system/cpu. This switching is an unavoidable consequnce
of reading all the .../cpuN/dscr values.

Remove the outer iteration loop from this test case, reducing the reads
from 1600 to 16. This still updates the DSCR 16 times and verifies on
every CPU each time, so I do not expect the lower coverage to be
meaningful. The speedup is significant: back down to ~1 second like the
other tests.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230406043320.125138-7-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/dscr: Improve DSCR explicit random test case</title>
<updated>2023-04-20T03:21:45Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-04-06T04:33:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3067b89ab62305c54ec15b00a2c4dbaf64809c59'/>
<id>urn:sha1:3067b89ab62305c54ec15b00a2c4dbaf64809c59</id>
<content type='text'>
The tests currently have a single writer thread updating the system
DSCR with a 1/1000 chance looped only 100 times. So only around one in
10 runs actually do anything.

* Add multiple threads to the dscr_explicit_random_test case.
* Use a barrier to make all the threads start work as simultaneously as
  possible.
* Use a rwlock and make all threads have a reasonable chance to write to
  the DSCR on each iteration.
  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is used to prevent
  writers from starving while all the other threads keep reading.
  Logging the reads/writes shows a decent mix across the whole test.
* Allow all threads a chance to write.
* Make the chance of writing more likely.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230406043320.125138-6-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/dscr: Add lockstep test cases to DSCR explicit tests</title>
<updated>2023-04-20T03:21:45Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-04-06T04:33:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fda8158870063b99b88a0904bbb95188973b4297'/>
<id>urn:sha1:fda8158870063b99b88a0904bbb95188973b4297</id>
<content type='text'>
Add new cases to the relevant tests that use explicitly synchronized
threads to test the behaviour across context switches with less
randomness. By locking the participants to the same CPU we guarantee a
context switch occurs each time they make progress, which is a likely
failure point if the kernel is not tracking the thread local DSCR
correctly.

The random case is left in to keep exercising potential edge cases.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230406043320.125138-5-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/dscr: Correct typos</title>
<updated>2023-04-20T03:21:45Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-04-06T04:33:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=15f0c2601e141e3c01c8dc3368b81181bc1c9228'/>
<id>urn:sha1:15f0c2601e141e3c01c8dc3368b81181bc1c9228</id>
<content type='text'>
Correct a couple of typos while working on other improvements to the
DSCR tests.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230406043320.125138-2-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Add {read,write}_{long,ulong}</title>
<updated>2023-02-09T12:56:45Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-02-03T00:39:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5c20de57888f0962e25a0eeec1a59c98056fc42e'/>
<id>urn:sha1:5c20de57888f0962e25a0eeec1a59c98056fc42e</id>
<content type='text'>
Add helper functions to read and write (unsigned) long values directly
from/to files. One of the kernel interfaces uses hex strings, so we need
to allow passing a base too.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20230203003947.38033-5-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Add generic read/write file util</title>
<updated>2023-02-09T12:56:45Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-02-03T00:39:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a974f0c131891027fe8490e654a220151b4caa82'/>
<id>urn:sha1:a974f0c131891027fe8490e654a220151b4caa82</id>
<content type='text'>
File read/write is reimplemented in about 5 different ways in the
various PowerPC selftests. This indicates it should be a common util.

Add a common read_file / write_file implementation and convert users
to it where (easily) possible.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20230203003947.38033-2-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Fix resource leaks</title>
<updated>2022-12-05T10:39:15Z</updated>
<author>
<name>Miaoqian Lin</name>
<email>linmq006@gmail.com</email>
</author>
<published>2022-12-05T08:44:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8f4ab7da904ab7027ccd43ddb4f0094e932a5877'/>
<id>urn:sha1:8f4ab7da904ab7027ccd43ddb4f0094e932a5877</id>
<content type='text'>
In check_all_cpu_dscr_defaults, opendir() opens the directory stream.
Add missing closedir() in the error path to release it.

In check_cpu_dscr_default, open() creates an open file descriptor.
Add missing close() in the error path to release it.

Fixes: ebd5858c904b ("selftests/powerpc: Add test for all DSCR sysfs interfaces")
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20221205084429.570654-1-linmq006@gmail.com

</content>
</entry>
</feed>
