torture: Specify qemu memory size with --memory argument
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 12 Jan 2018 22:19:05 +0000 (14:19 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 21 Feb 2018 00:21:59 +0000 (16:21 -0800)
The 512 megabyte memory size has served quite well, but more memory
is required when using large trace buffers on large systems.  This
commit therefore adds a --memory argument to the kvm.sh script, which
allows the memory size to be specified on the command line, for example,
"--memory 768", --memory 800M", or "--memory 2G".

Reported-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
tools/testing/selftests/rcutorture/bin/kvm.sh

index 1b78a12740e5695ee1c1214e9bd9b5c2fd638644..5f8fbb0d7c17ecb155a27785473b6cc6f618cec8 100755 (executable)
@@ -177,8 +177,8 @@ then
        exit 0
 fi
 echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
-echo $QEMU $qemu_args -m 512 -kernel $KERNEL -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
-( $QEMU $qemu_args -m 512 -kernel $KERNEL -append "$qemu_append $boot_args"& echo $! > $resdir/qemu_pid; wait `cat  $resdir/qemu_pid`; echo $? > $resdir/qemu-retval ) &
+echo $QEMU $qemu_args -m $TORTURE_QEMU_MEM -kernel $KERNEL -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
+( $QEMU $qemu_args -m $TORTURE_QEMU_MEM -kernel $KERNEL -append "$qemu_append $boot_args"& echo $! > $resdir/qemu_pid; wait `cat  $resdir/qemu_pid`; echo $? > $resdir/qemu-retval ) &
 commandcompleted=0
 sleep 10 # Give qemu's pid a chance to reach the file
 if test -s "$resdir/qemu_pid"
index 1fa05132774dade9cac8c8fca4342247771db1c9..f3c3d33150a0f61c05faa5f74b144863095af81e 100755 (executable)
@@ -42,6 +42,7 @@ TORTURE_BOOT_IMAGE=""
 TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
 TORTURE_KCONFIG_ARG=""
 TORTURE_KMAKE_ARG=""
+TORTURE_QEMU_MEM=512
 TORTURE_SHUTDOWN_GRACE=180
 TORTURE_SUITE=rcu
 resdir=""
@@ -68,6 +69,7 @@ usage () {
        echo "       --kconfig Kconfig-options"
        echo "       --kmake-arg kernel-make-arguments"
        echo "       --mac nn:nn:nn:nn:nn:nn"
+       echo "       --memory megabytes | nnnG"
        echo "       --no-initrd"
        echo "       --qemu-args qemu-arguments"
        echo "       --qemu-cmd qemu-system-..."
@@ -145,6 +147,11 @@ do
                TORTURE_QEMU_MAC=$2
                shift
                ;;
+       --memory)
+               checkarg --memory "(memory size)" $# "$2" '^[0-9]\+[MG]\?$' error
+               TORTURE_QEMU_MEM=$2
+               shift
+               ;;
        --no-initrd)
                TORTURE_INITRD=""; export TORTURE_INITRD
                ;;
@@ -286,6 +293,7 @@ TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG"; export TORTURE_KMAKE_ARG
 TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD"; export TORTURE_QEMU_CMD
 TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE"; export TORTURE_QEMU_INTERACTIVE
 TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC"; export TORTURE_QEMU_MAC
+TORTURE_QEMU_MEM="$TORTURE_QEMU_MEM"; export TORTURE_QEMU_MEM
 TORTURE_SHUTDOWN_GRACE="$TORTURE_SHUTDOWN_GRACE"; export TORTURE_SHUTDOWN_GRACE
 TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
 if ! test -e $resdir