diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2023-04-06 14:33:18 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-04-20 13:21:45 +1000 |
commit | 3067b89ab62305c54ec15b00a2c4dbaf64809c59 (patch) | |
tree | 6a0510188657f203925daa32b1f9ffebb5fb8c9d /kernel/context_tracking.c | |
parent | fda8158870063b99b88a0904bbb95188973b4297 (diff) |
selftests/powerpc/dscr: Improve DSCR explicit random test case
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 <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230406043320.125138-6-bgray@linux.ibm.com
Diffstat (limited to 'kernel/context_tracking.c')
0 files changed, 0 insertions, 0 deletions