@@ -19,10 +19,10 @@ PATH=${RCUTORTURE}/bin:$PATH; export PATH
19
19
20
20
TORTURE_ALLOTED_CPUS=" ` identify_qemu_vcpus` "
21
21
MAKE_ALLOTED_CPUS=$(( TORTURE_ALLOTED_CPUS* 2 ))
22
- HALF_ALLOTED_CPUS =$(( TORTURE_ALLOTED_CPUS/ 2 ))
23
- if test " $HALF_ALLOTED_CPUS " -lt 1
22
+ SCALE_ALLOTED_CPUS =$(( TORTURE_ALLOTED_CPUS/ 2 ))
23
+ if test " $SCALE_ALLOTED_CPUS " -lt 1
24
24
then
25
- HALF_ALLOTED_CPUS =1
25
+ SCALE_ALLOTED_CPUS =1
26
26
fi
27
27
VERBOSE_BATCH_CPUS=$(( TORTURE_ALLOTED_CPUS/ 16 ))
28
28
if test " $VERBOSE_BATCH_CPUS " -lt 2
@@ -90,6 +90,7 @@ usage () {
90
90
echo " --do-scftorture / --do-no-scftorture / --no-scftorture"
91
91
echo " --do-srcu-lockdep / --do-no-srcu-lockdep / --no-srcu-lockdep"
92
92
echo " --duration [ <minutes> | <hours>h | <days>d ]"
93
+ echo " --guest-cpu-limit N"
93
94
echo " --kcsan-kmake-arg kernel-make-arguments"
94
95
exit 1
95
96
}
203
204
duration_base=$(( $ts * mult))
204
205
shift
205
206
;;
207
+ --guest-cpu-limit|--guest-cpu-lim)
208
+ checkarg --guest-cpu-limit " (number)" " $# " " $2 " ' ^[0-9]*$' ' ^--'
209
+ if (( "$2 " <= "$TORTURE_ALLOTED_CPUS " / 2 ))
210
+ then
211
+ SCALE_ALLOTED_CPUS=" $2 "
212
+ VERBOSE_BATCH_CPUS=" $(( SCALE_ALLOTED_CPUS/ 8 )) "
213
+ if (( "$VERBOSE_BATCH_CPUS " < 2 ))
214
+ then
215
+ VERBOSE_BATCH_CPUS=0
216
+ fi
217
+ else
218
+ echo " Ignoring value of $2 for --guest-cpu-limit which is greater than ((" $TORTURE_ALLOTED_CPUS " / 2))."
219
+ fi
220
+ shift
221
+ ;;
206
222
--kcsan-kmake-arg|--kcsan-kmake-args)
207
223
checkarg --kcsan-kmake-arg " (kernel make arguments)" $# " $2 " ' .*' ' ^error$'
208
224
kcsan_kmake_args=" ` echo " $kcsan_kmake_args $2 " | sed -e ' s/^ *//' -e ' s/ *$//' ` "
425
441
if test " $do_scftorture " = " yes"
426
442
then
427
443
# Scale memory based on the number of CPUs.
428
- scfmem=$(( 3 + HALF_ALLOTED_CPUS / 16 ))
429
- torture_bootargs=" scftorture.nthreads=$HALF_ALLOTED_CPUS torture.disable_onoff_at_boot csdlock_debug=1"
430
- torture_set " scftorture" tools/testing/selftests/rcutorture/bin/kvm.sh --torture scf --allcpus --duration " $duration_scftorture " --configs " $configs_scftorture " --kconfig " CONFIG_NR_CPUS=$HALF_ALLOTED_CPUS " --memory ${scfmem} G --trust-make
444
+ scfmem=$(( 3 + SCALE_ALLOTED_CPUS / 16 ))
445
+ torture_bootargs=" scftorture.nthreads=$SCALE_ALLOTED_CPUS torture.disable_onoff_at_boot csdlock_debug=1"
446
+ torture_set " scftorture" tools/testing/selftests/rcutorture/bin/kvm.sh --torture scf --allcpus --duration " $duration_scftorture " --configs " $configs_scftorture " --kconfig " CONFIG_NR_CPUS=$SCALE_ALLOTED_CPUS " --memory ${scfmem} G --trust-make
431
447
fi
432
448
433
449
if test " $do_rt " = " yes"
@@ -471,8 +487,8 @@ for prim in $primlist
471
487
do
472
488
if test -n " $firsttime "
473
489
then
474
- torture_bootargs=" refscale.scale_type=" $prim " refscale.nreaders=$HALF_ALLOTED_CPUS refscale.loops=10000 refscale.holdoff=20 torture.disable_onoff_at_boot"
475
- torture_set " refscale-$prim " tools/testing/selftests/rcutorture/bin/kvm.sh --torture refscale --allcpus --duration 5 --kconfig " CONFIG_TASKS_TRACE_RCU=y CONFIG_NR_CPUS=$HALF_ALLOTED_CPUS " --bootargs " refscale.verbose_batched=$VERBOSE_BATCH_CPUS torture.verbose_sleep_frequency=8 torture.verbose_sleep_duration=$VERBOSE_BATCH_CPUS " --trust-make
490
+ torture_bootargs=" refscale.scale_type=" $prim " refscale.nreaders=$SCALE_ALLOTED_CPUS refscale.loops=10000 refscale.holdoff=20 torture.disable_onoff_at_boot"
491
+ torture_set " refscale-$prim " tools/testing/selftests/rcutorture/bin/kvm.sh --torture refscale --allcpus --duration 5 --kconfig " CONFIG_TASKS_TRACE_RCU=y CONFIG_NR_CPUS=$SCALE_ALLOTED_CPUS " --bootargs " refscale.verbose_batched=$VERBOSE_BATCH_CPUS torture.verbose_sleep_frequency=8 torture.verbose_sleep_duration=$VERBOSE_BATCH_CPUS " --trust-make
476
492
mv $T /last-resdir-nodebug $T /first-resdir-nodebug || :
477
493
if test -f " $T /last-resdir-kasan"
478
494
then
@@ -520,8 +536,8 @@ for prim in $primlist
520
536
do
521
537
if test -n " $firsttime "
522
538
then
523
- torture_bootargs=" rcuscale.scale_type=" $prim " rcuscale.nwriters=$HALF_ALLOTED_CPUS rcuscale.holdoff=20 torture.disable_onoff_at_boot"
524
- torture_set " rcuscale-$prim " tools/testing/selftests/rcutorture/bin/kvm.sh --torture rcuscale --allcpus --duration 5 --kconfig " CONFIG_TASKS_TRACE_RCU=y CONFIG_NR_CPUS=$HALF_ALLOTED_CPUS " --trust-make
539
+ torture_bootargs=" rcuscale.scale_type=" $prim " rcuscale.nwriters=$SCALE_ALLOTED_CPUS rcuscale.holdoff=20 torture.disable_onoff_at_boot"
540
+ torture_set " rcuscale-$prim " tools/testing/selftests/rcutorture/bin/kvm.sh --torture rcuscale --allcpus --duration 5 --kconfig " CONFIG_TASKS_TRACE_RCU=y CONFIG_NR_CPUS=$SCALE_ALLOTED_CPUS " --trust-make
525
541
mv $T /last-resdir-nodebug $T /first-resdir-nodebug || :
526
542
if test -f " $T /last-resdir-kasan"
527
543
then
@@ -559,7 +575,7 @@ do_kcsan="$do_kcsan_save"
559
575
if test " $do_kvfree " = " yes"
560
576
then
561
577
torture_bootargs=" rcuscale.kfree_rcu_test=1 rcuscale.kfree_nthreads=16 rcuscale.holdoff=20 rcuscale.kfree_loops=10000 torture.disable_onoff_at_boot"
562
- torture_set " rcuscale-kvfree" tools/testing/selftests/rcutorture/bin/kvm.sh --torture rcuscale --allcpus --duration $duration_rcutorture --kconfig " CONFIG_NR_CPUS=$HALF_ALLOTED_CPUS " --memory 2G --trust-make
578
+ torture_set " rcuscale-kvfree" tools/testing/selftests/rcutorture/bin/kvm.sh --torture rcuscale --allcpus --duration $duration_rcutorture --kconfig " CONFIG_NR_CPUS=$SCALE_ALLOTED_CPUS " --memory 2G --trust-make
563
579
fi
564
580
565
581
if test " $do_clocksourcewd " = " yes"
0 commit comments