aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-07-21 16:35:10 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-09-07 19:24:45 -0400
commitae867ff03d09c2aec56b0443b8b04e5a3fa1e336 (patch)
tree5dcf8666e614728446264aee38f3e4265c8e549b /tools/testing
parent9e62b0efdcead5b66c0c006df2f19a449b22cf08 (diff)
rcutorture: Specify MAXSMP=y for TREE01
Setting CONFIG_MAXSMP=y causes cpumasks to be moved offstack, which introduces the possibility of NULL cpumask_var_t pointers. This commit therefore enables CONFIG_MAXSMP=y in TREE01 to increase test coverage. However, because CONFIG_MAXSMP=y implies 8192 CPUs, we need to use the maxcpus= boot parameter to limit the number of CPUs to something reasonable, which in turn requires updating the scripts to handle this. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/rcutorture/bin/functions.sh20
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh1
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh4
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE014
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot2
5 files changed, 26 insertions, 5 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index d01b865bb100..b325470c01b3 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -64,6 +64,26 @@ configfrag_boot_params () {
64 fi 64 fi
65} 65}
66 66
67# configfrag_boot_cpus bootparam-string config-fragment-file config-cpus
68#
69# Decreases number of CPUs based on any maxcpus= boot parameters specified.
70configfrag_boot_cpus () {
71 local bootargs="`configfrag_boot_params "$1" "$2"`"
72 local maxcpus
73 if echo "${bootargs}" | grep -q 'maxcpus=[0-9]'
74 then
75 maxcpus="`echo "${bootargs}" | sed -e 's/^.*maxcpus=\([0-9]*\).*$/\1/'`"
76 if test "$3" -gt "$maxcpus"
77 then
78 echo $maxcpus
79 else
80 echo $3
81 fi
82 else
83 echo $3
84 fi
85}
86
67# configfrag_hotplug_cpu config-fragment-file 87# configfrag_hotplug_cpu config-fragment-file
68# 88#
69# Returns 1 if the config fragment specifies hotplug CPU. 89# Returns 1 if the config fragment specifies hotplug CPU.
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index 6d2f5fa48484..487308fabf76 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -140,6 +140,7 @@ fi
140# Generate -smp qemu argument. 140# Generate -smp qemu argument.
141qemu_args="-nographic $qemu_args" 141qemu_args="-nographic $qemu_args"
142cpu_count=`configNR_CPUS.sh $config_template` 142cpu_count=`configNR_CPUS.sh $config_template`
143cpu_count=`configfrag_boot_cpus "$boot_args" "$config_template" "$cpu_count"`
143vcpus=`identify_qemu_vcpus` 144vcpus=`identify_qemu_vcpus`
144if test $cpu_count -gt $vcpus 145if test $cpu_count -gt $vcpus
145then 146then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 36534f9938ca..e527dc952eb0 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -188,7 +188,9 @@ for CF in $configs
188do 188do
189 if test -f "$CONFIGFRAG/$kversion/$CF" 189 if test -f "$CONFIGFRAG/$kversion/$CF"
190 then 190 then
191 echo $CF `configNR_CPUS.sh $CONFIGFRAG/$kversion/$CF` >> $T/cfgcpu 191 cpu_count=`configNR_CPUS.sh $CONFIGFRAG/$kversion/$CF`
192 cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$kversion/$CF" "$cpu_count"`
193 echo $CF $cpu_count >> $T/cfgcpu
192 else 194 else
193 echo "The --configs file $CF does not exist, terminating." 195 echo "The --configs file $CF does not exist, terminating."
194 exit 1 196 exit 1
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE01 b/tools/testing/selftests/rcutorture/configs/rcu/TREE01
index 063b7079c621..38e3895759dd 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/TREE01
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE01
@@ -1,5 +1,4 @@
1CONFIG_SMP=y 1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=n 2CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n 3CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y 4CONFIG_PREEMPT=y
@@ -10,8 +9,7 @@ CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=y 9CONFIG_RCU_FAST_NO_HZ=y
11CONFIG_RCU_TRACE=y 10CONFIG_RCU_TRACE=y
12CONFIG_HOTPLUG_CPU=y 11CONFIG_HOTPLUG_CPU=y
13CONFIG_RCU_FANOUT=8 12CONFIG_MAXSMP=y
14CONFIG_RCU_FANOUT_EXACT=n
15CONFIG_RCU_NOCB_CPU=y 13CONFIG_RCU_NOCB_CPU=y
16CONFIG_RCU_NOCB_CPU_ZERO=y 14CONFIG_RCU_NOCB_CPU_ZERO=y
17CONFIG_DEBUG_LOCK_ALLOC=n 15CONFIG_DEBUG_LOCK_ALLOC=n
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot
index 0fc8a3428938..adc3abc82fb8 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot
@@ -1 +1 @@
rcutorture.torture_type=rcu_bh rcutorture.torture_type=rcu_bh maxcpus=8