3 # SPDX-License-Identifier: GPL-2.0-only
5 # SPDX-FileCopyrightText: 2022 EfficiOS Inc.
8 if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then
9 UTILSSH
="$URCU_TESTS_SRCDIR/utils/utils.sh"
11 UTILSSH
="$(dirname "$0")/../utils/utils.sh"
17 # shellcheck source=../utils/utils.sh
21 # First parameter: seconds per test
24 if [ "x${DURATION}" = "x" ]; then
25 echo "usage: $0 [DURATION]"
29 # Create a temporary file for tests output
32 # Set trap to delete the temporary file on exit and call tap.sh '_exit'
33 trap 'rm -f "$TMPFILE"; _exit' EXIT
35 # Set to number of active CPUS
36 NUM_CPUS
="$(urcu_nproc)"
37 if [[ ${NUM_CPUS} -lt 4 ]]; then
38 NUM_CPUS
=4 # Floor at 4 due to following assumptions.
43 # scalabilit NUM_CPUS * 15
45 NUM_TESTS
=$
(( 19 + 435 + ( NUM_CPUS
* 15 ) + 345 ))
47 plan_tests
${NUM_TESTS}
50 diag
"Executing URCU tests"
53 #extra options, e.g. for setting affinity on even CPUs :
54 #EXTRA_OPTS=$(for a in $(seq 0 2 127); do echo -n "-a ${a} "; done)
56 #ppc64 striding, use with NUM_CPUS=8
59 #EXTRA_OPTS=$(for a in $(seq 0 2 15); do echo -n "-a ${a} "; done)
61 #EXTRA_OPTS=$(for a in $(seq 0 4 31); do echo -n "-a ${a} "; done)
63 #EXTRA_OPTS=$(for a in $(seq 0 8 63); do echo -n "-a ${a} "; done)
65 #EXTRA_OPTS=$(for a in $(seq 0 16 127); do echo -n "-a ${a} "; done)
68 #x: vary update fraction from 0 to 0.0001
69 #fix number of readers and reader C.S. length, vary delay between updates
74 diag
"Executing batch RCU test"
76 BATCH_ARRAY
="1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
78 BATCH_TEST_ARRAY
="test_urcu_gc"
80 NR_WRITERS
=$
((NUM_CPUS
/ 2))
81 NR_READERS
=$
((NUM_CPUS
- NR_WRITERS
))
83 for BATCH_SIZE
in ${BATCH_ARRAY}; do
84 for TEST
in ${BATCH_TEST_ARRAY}; do
85 okx
${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \
86 -d 0 -b "${BATCH_SIZE}" ${EXTRA_OPTS} 2>"${TMPFILE}"
87 while read -r line; do
93 TEST_ARRAY
="test_urcu_gc test_urcu_signal_gc test_urcu_mb_gc test_urcu_qsbr_gc
94 test_urcu_lgc test_urcu_signal_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc
95 test_urcu test_urcu_signal test_urcu_mb test_urcu_qsbr
96 test_rwlock test_perthreadlock test_mutex"
98 #setting gc each 32768. ** UPDATE FOR YOUR ARCHITECTURE BASED ON TEST ABOVE **
99 EXTRA_OPTS
="${EXTRA_OPTS} -b 32768"
101 diag
"Executing update fraction test"
103 WDELAY_ARRAY
="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
104 65536 131072 262144 524288 1048576 2097152 4194304 8388608
105 16777216 33554432 67108864 134217728"
106 NR_WRITERS
=$
((NUM_CPUS
/ 2))
107 NR_READERS
=$
((NUM_CPUS
- NR_WRITERS
))
109 for WDELAY
in ${WDELAY_ARRAY}; do
110 for TEST
in ${TEST_ARRAY}; do
111 okx
${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \
112 -d "${WDELAY}" ${EXTRA_OPTS} 2>"${TMPFILE}"
113 while read -r line; do
120 # x: vary number of readers from 0 to num cpus
124 diag
"Executing scalability test"
128 for NR_READERS
in $
(urcu_xseq
1 ${NUM_CPUS}); do
129 for TEST
in ${TEST_ARRAY}; do
130 okx
${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \
131 ${EXTRA_OPTS} 2>"${TMPFILE}"
132 while read -r line; do
139 # x: Vary reader C.S. length from 0 to 100 us
144 diag
"Executing reader C.S. length test"
146 NR_READERS
=${NUM_CPUS}
149 READERCSLEN_ARRAY
="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152"
151 for READERCSLEN
in ${READERCSLEN_ARRAY}; do
152 for TEST
in ${TEST_ARRAY}; do
153 okx
${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \
154 -c "${READERCSLEN}" ${EXTRA_OPTS} 2>"${TMPFILE}"
155 while read -r line; do
This page took 0.036475 seconds and 4 git commands to generate.