]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rcutorture: Specify MAXSMP=y for TREE01
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 21 Jul 2014 20:35:10 +0000 (13:35 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 7 Sep 2014 23:24:45 +0000 (16:24 -0700)
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>
tools/testing/selftests/rcutorture/bin/functions.sh
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
tools/testing/selftests/rcutorture/bin/kvm.sh
tools/testing/selftests/rcutorture/configs/rcu/TREE01
tools/testing/selftests/rcutorture/configs/rcu/TREE01.boot

index d01b865bb1002fa00e9351e42a2648109f7e1968..b325470c01b3669e38dcdcc13e674b011f97c7b7 100644 (file)
@@ -64,6 +64,26 @@ configfrag_boot_params () {
        fi
 }
 
+# configfrag_boot_cpus bootparam-string config-fragment-file config-cpus
+#
+# Decreases number of CPUs based on any maxcpus= boot parameters specified.
+configfrag_boot_cpus () {
+       local bootargs="`configfrag_boot_params "$1" "$2"`"
+       local maxcpus
+       if echo "${bootargs}" | grep -q 'maxcpus=[0-9]'
+       then
+               maxcpus="`echo "${bootargs}" | sed -e 's/^.*maxcpus=\([0-9]*\).*$/\1/'`"
+               if test "$3" -gt "$maxcpus"
+               then
+                       echo $maxcpus
+               else
+                       echo $3
+               fi
+       else
+               echo $3
+       fi
+}
+
 # configfrag_hotplug_cpu config-fragment-file
 #
 # Returns 1 if the config fragment specifies hotplug CPU.
index 6d2f5fa48484fb2889a730dc0f6a3409cf90e6ba..487308fabf76993aeab2091a4b3edb04bc8e0850 100755 (executable)
@@ -140,6 +140,7 @@ fi
 # Generate -smp qemu argument.
 qemu_args="-nographic $qemu_args"
 cpu_count=`configNR_CPUS.sh $config_template`
+cpu_count=`configfrag_boot_cpus "$boot_args" "$config_template" "$cpu_count"`
 vcpus=`identify_qemu_vcpus`
 if test $cpu_count -gt $vcpus
 then
index 36534f9938ca5d91571b7ea1969db743ac83d3a3..e527dc952eb010553a9dca7b76d2b324b541a44b 100755 (executable)
@@ -188,7 +188,9 @@ for CF in $configs
 do
        if test -f "$CONFIGFRAG/$kversion/$CF"
        then
-               echo $CF `configNR_CPUS.sh $CONFIGFRAG/$kversion/$CF` >> $T/cfgcpu
+               cpu_count=`configNR_CPUS.sh $CONFIGFRAG/$kversion/$CF`
+               cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$kversion/$CF" "$cpu_count"`
+               echo $CF $cpu_count >> $T/cfgcpu
        else
                echo "The --configs file $CF does not exist, terminating."
                exit 1
index 063b7079c621294f06a29d2983f8e9af0b965102..38e3895759dd6ee2b05589fd75aaea92980337ae 100644 (file)
@@ -1,5 +1,4 @@
 CONFIG_SMP=y
-CONFIG_NR_CPUS=8
 CONFIG_PREEMPT_NONE=n
 CONFIG_PREEMPT_VOLUNTARY=n
 CONFIG_PREEMPT=y
@@ -10,8 +9,7 @@ CONFIG_NO_HZ_FULL=n
 CONFIG_RCU_FAST_NO_HZ=y
 CONFIG_RCU_TRACE=y
 CONFIG_HOTPLUG_CPU=y
-CONFIG_RCU_FANOUT=8
-CONFIG_RCU_FANOUT_EXACT=n
+CONFIG_MAXSMP=y
 CONFIG_RCU_NOCB_CPU=y
 CONFIG_RCU_NOCB_CPU_ZERO=y
 CONFIG_DEBUG_LOCK_ALLOC=n
index 0fc8a3428938f8fcd3bbb5d0a80aa9ab2161e40d..adc3abc82fb8241308a75d8a05f1168b1ec2e417 100644 (file)
@@ -1 +1 @@
-rcutorture.torture_type=rcu_bh
+rcutorture.torture_type=rcu_bh maxcpus=8