Received: by 10.223.176.46 with SMTP id f43csp1729304wra; Wed, 24 Jan 2018 22:32:08 -0800 (PST) X-Google-Smtp-Source: AH8x227iaFLm8EOhzxbgCeybbJrpnN1+ZF7vppwErddfg0GLVeAGqjTiPWvtZPwB5yENd1CMbDXt X-Received: by 10.99.131.74 with SMTP id h71mr12316720pge.373.1516861928092; Wed, 24 Jan 2018 22:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516861928; cv=none; d=google.com; s=arc-20160816; b=enjCX0lDw37aZxEBI+qB4uMNps0J+CliVqrVVs9lrjCDOMGdyqhrBAgN6e/2M3gkvi IaWYcUA7L+6jZfffITM5OlELG/yvU0Ph8Rql0S5VWI1IjU5RA9Ko/0c4M1Z92drFQtPj Sd0gyndh/VPjmMmygg7T80WXOiHrRwFafl7CSF2mvSj0IqJ0PGPjPoWzNiXTBsTdyH2E 6p5U+tSEIAKQAHr9BI5Ur9rgAiCufVmM0tWFFYzOglYCbG4eHm5pB4NM7Bw7K/px4uj6 Llt7hF3FFn9lyD/zX3zQ1Welmj7SNM15GlUpVro6khl1koKI9Q7/4LiVjQ2Fk5ldwZkP CEiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=oMGWGgZTrpfAAs6TH+8GPRcVHNR8qkVhPX0Ml3RlFr8=; b=tmi5PDufMEJIdpRwkSsSjIh0v9pvh8uhKIvWCwHoC2mE+2rABW7zKVbCVXX7RJYCF9 +1Snr8hOCLP7o5tT1KiqTdh1w3NZdJSoJsA28uS5HV/jDyFzs4XSLy3KmD6g/PRzPEyS D4qj3cSiAV++VIW4KEqbwXEcdLgmxqvpJRFFF2DG7vACqqpcbMoIPJjptyAM+Q5lUvP0 YExRz7FHfUFxMl5E3JoCwODzagZ6BjL14RsSJcyjS9Vj/Tdr1Xbn9ufgkZVXybiugwHq muDDXXyj/qbTCmF3r9OmUemocCICsvR+cFBo0EQij2yn9+FVpCu5XAiELtfIDvYSYjp4 VFlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v65si1163254pgb.238.2018.01.24.22.31.54; Wed, 24 Jan 2018 22:32:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbeAYGai (ORCPT + 99 others); Thu, 25 Jan 2018 01:30:38 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41328 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751200AbeAYGaD (ORCPT ); Thu, 25 Jan 2018 01:30:03 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0P6SsSL109341 for ; Thu, 25 Jan 2018 01:30:00 -0500 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fq9ha9bd2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 25 Jan 2018 01:30:00 -0500 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Jan 2018 01:29:57 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Jan 2018 01:29:54 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0P6TrAO46858296; Thu, 25 Jan 2018 06:29:53 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A555B2058; Thu, 25 Jan 2018 01:26:52 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.85.153.144]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 447E8B2056; Thu, 25 Jan 2018 01:26:51 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 2CC1016C3739; Wed, 24 Jan 2018 22:28:55 -0800 (PST) Date: Wed, 24 Jan 2018 22:28:55 -0800 From: "Paul E. McKenney" To: lianglihao@huawei.com Cc: guohanjun@huawei.com, heng.z@huawei.com, hb.chen@huawei.com, lihao.liang@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 15/16] rcutorture: Add scripts to run experiments Reply-To: paulmck@linux.vnet.ibm.com References: <1516694381-20333-1-git-send-email-lianglihao@huawei.com> <1516694381-20333-16-git-send-email-lianglihao@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516694381-20333-16-git-send-email-lianglihao@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18012506-0052-0000-0000-000002A9697B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008423; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00980015; UDB=6.00496769; IPR=6.00759317; BA=6.00005794; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019197; XFM=3.00000015; UTC=2018-01-25 06:29:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012506-0053-0000-0000-0000535B1701 Message-Id: <20180125062855.GZ3741@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-25_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801250090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 23, 2018 at 03:59:40PM +0800, lianglihao@huawei.com wrote: > From: Lihao Liang > > Signed-off-by: Lihao Liang > --- > kvm.sh | 452 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > run-rcuperf.sh | 26 ++++ The usual approach would be to add what you need to the existing kvm.sh... Thanx, Paul > 2 files changed, 478 insertions(+) > create mode 100755 kvm.sh > create mode 100755 run-rcuperf.sh > > diff --git a/kvm.sh b/kvm.sh > new file mode 100755 > index 00000000..3b3c1b69 > --- /dev/null > +++ b/kvm.sh > @@ -0,0 +1,452 @@ > +#!/bin/bash > +# > +# Run a series of 14 tests under KVM. These are not particularly > +# well-selected or well-tuned, but are the current set. Run from the > +# top level of the source tree. > +# > +# Edit the definitions below to set the locations of the various directories, > +# as well as the test duration. > +# > +# Usage: kvm.sh [ options ] > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 2 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, you can access it online at > +# http://www.gnu.org/licenses/gpl-2.0.html. > +# > +# Copyright (C) IBM Corporation, 2011 > +# > +# Authors: Paul E. McKenney > + > +scriptname=$0 > +args="$*" > + > +T=/tmp/kvm.sh.$$ > +trap 'rm -rf $T' 0 > +mkdir $T > + > +dur=$((30*60)) > +dryrun="" > +KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM > +PATH=${KVM}/bin:$PATH; export PATH > +TORTURE_DEFCONFIG=defconfig > +TORTURE_BOOT_IMAGE="" > +TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD > +TORTURE_KMAKE_ARG="" > +TORTURE_SHUTDOWN_GRACE=180 > +TORTURE_SUITE=rcu > +resdir="" > +configs="" > +cpus=0 > +ds=`date +%Y.%m.%d-%H:%M:%S` > +jitter="-1" > + > +. functions.sh > + > +usage () { > + echo "Usage: $scriptname optional arguments:" > + echo " --bootargs kernel-boot-arguments" > + echo " --bootimage relative-path-to-kernel-boot-image" > + echo " --buildonly" > + echo " --configs \"config-file list w/ repeat factor (3*TINY01)\"" > + echo " --cpus N" > + echo " --datestamp string" > + echo " --defconfig string" > + echo " --dryrun sched|script" > + echo " --duration minutes" > + echo " --interactive" > + echo " --jitter N [ maxsleep (us) [ maxspin (us) ] ]" > + echo " --kmake-arg kernel-make-arguments" > + echo " --mac nn:nn:nn:nn:nn:nn" > + echo " --no-initrd" > + echo " --qemu-args qemu-system-..." > + echo " --qemu-cmd qemu-system-..." > + echo " --results absolute-pathname" > + echo " --torture rcu" > + exit 1 > +} > + > +while test $# -gt 0 > +do > + case "$1" in > + --bootargs|--bootarg) > + checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--' > + TORTURE_BOOTARGS="$2" > + shift > + ;; > + --bootimage) > + checkarg --bootimage "(relative path to kernel boot image)" "$#" "$2" '[a-zA-Z0-9][a-zA-Z0-9_]*' '^--' > + TORTURE_BOOT_IMAGE="$2" > + shift > + ;; > + --buildonly) > + TORTURE_BUILDONLY=1 > + ;; > + --configs|--config) > + checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--' > + configs="$2" > + shift > + ;; > + --cpus) > + checkarg --cpus "(number)" "$#" "$2" '^[0-9]*$' '^--' > + cpus=$2 > + shift > + ;; > + --datestamp) > + checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--' > + ds=$2 > + shift > + ;; > + --defconfig) > + checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--' > + TORTURE_DEFCONFIG=$2 > + shift > + ;; > + --dryrun) > + checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--' > + dryrun=$2 > + shift > + ;; > + --duration) > + checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error' > + dur=$(($2*60)) > + shift > + ;; > + --interactive) > + TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE > + ;; > + --jitter) > + checkarg --jitter "(# threads [ sleep [ spin ] ])" $# "$2" '^-\{,1\}[0-9]\+\( \+[0-9]\+\)\{,2\} *$' '^error$' > + jitter="$2" > + shift > + ;; > + --kmake-arg) > + checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$' > + TORTURE_KMAKE_ARG="$2" > + shift > + ;; > + --mac) > + checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error > + TORTURE_QEMU_MAC=$2 > + shift > + ;; > + --no-initrd) > + TORTURE_INITRD=""; export TORTURE_INITRD > + ;; > + --qemu-args|--qemu-arg) > + checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error' > + TORTURE_QEMU_ARG="$2" > + shift > + ;; > + --qemu-cmd) > + checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--' > + TORTURE_QEMU_CMD="$2" > + shift > + ;; > + --results) > + checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error' > + resdir=$2 > + shift > + ;; > + --shutdown-grace) > + checkarg --shutdown-grace "(seconds)" "$#" "$2" '^[0-9]*$' '^error' > + TORTURE_SHUTDOWN_GRACE=$2 > + shift > + ;; > + --torture) > + checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\)$' '^--' > + TORTURE_SUITE=$2 > + shift > + ;; > + *) > + echo Unknown argument $1 > + usage > + ;; > + esac > + shift > +done > + > +CONFIGFRAG=${KVM}/configs/${TORTURE_SUITE}; export CONFIGFRAG > + > +if test -z "$configs" > +then > + configs="`cat $CONFIGFRAG/CFLIST`" > +fi > + > +if test -z "$resdir" > +then > + resdir=$KVM/res > +fi > + > +# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus. > +touch $T/cfgcpu > +for CF in $configs > +do > + case $CF in > + [0-9]\**|[0-9][0-9]\**|[0-9][0-9][0-9]\**) > + config_reps=`echo $CF | sed -e 's/\*.*$//'` > + CF1=`echo $CF | sed -e 's/^[^*]*\*//'` > + ;; > + *) > + config_reps=1 > + CF1=$CF > + ;; > + esac > + if test -f "$CONFIGFRAG/$CF1" > + then > + cpu_count=`configNR_CPUS.sh $CONFIGFRAG/$CF1` > + cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"` > + for ((cur_rep=0;cur_rep<$config_reps;cur_rep++)) > + do > + echo $CF1 $cpu_count >> $T/cfgcpu > + done > + else > + echo "The --configs file $CF1 does not exist, terminating." > + exit 1 > + fi > +done > +sort -k2nr $T/cfgcpu > $T/cfgcpu.sort > + > +# Use a greedy bin-packing algorithm, sorting the list accordingly. > +awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus ' > +BEGIN { > + njobs = 0; > +} > + > +{ > + # Read file of tests and corresponding required numbers of CPUs. > + cf[njobs] = $1; > + cpus[njobs] = $2; > + njobs++; > +} > + > +END { > + alldone = 0; > + batch = 0; > + nc = -1; > + > + # Each pass through the following loop creates on test batch > + # that can be executed concurrently given ncpus. Note that a > + # given test that requires more than the available CPUs will run in > + # their own batch. Such tests just have to make do with what > + # is available. > + while (nc != ncpus) { > + batch++; > + nc = ncpus; > + > + # Each pass through the following loop considers one > + # test for inclusion in the current batch. > + for (i = 0; i < njobs; i++) { > + if (done[i]) > + continue; # Already part of a batch. > + if (nc >= cpus[i] || nc == ncpus) { > + > + # This test fits into the current batch. > + done[i] = batch; > + nc -= cpus[i]; > + if (nc <= 0) > + break; # Too-big test in its own batch. > + } > + } > + } > + > + # Dump out the tests in batch order. > + for (b = 1; b <= batch; b++) > + for (i = 0; i < njobs; i++) > + if (done[i] == b) > + print cf[i], cpus[i]; > +}' > + > +# Generate a script to execute the tests in appropriate batches. > +cat << ___EOF___ > $T/script > +CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG > +KVM="$KVM"; export KVM > +PATH="$PATH"; export PATH > +TORTURE_BOOT_IMAGE="$TORTURE_BOOT_IMAGE"; export TORTURE_BOOT_IMAGE > +TORTURE_BUILDONLY="$TORTURE_BUILDONLY"; export TORTURE_BUILDONLY > +TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG > +TORTURE_INITRD="$TORTURE_INITRD"; export TORTURE_INITRD > +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_SHUTDOWN_GRACE="$TORTURE_SHUTDOWN_GRACE"; export TORTURE_SHUTDOWN_GRACE > +TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE > +if ! test -e $resdir > +then > + mkdir -p "$resdir" || : > +fi > +mkdir $resdir/$ds > +echo Results directory: $resdir/$ds > +echo $scriptname $args > +touch $resdir/$ds/log > +echo $scriptname $args >> $resdir/$ds/log > +echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE > +pwd > $resdir/$ds/testid.txt > +if test -d .git > +then > + git status >> $resdir/$ds/testid.txt > + git rev-parse HEAD >> $resdir/$ds/testid.txt > + if ! git diff HEAD > $T/git-diff 2>&1 > + then > + cp $T/git-diff $resdir/$ds > + fi > +fi > +___EOF___ > +awk < $T/cfgcpu.pack \ > + -v TORTURE_BUILDONLY="$TORTURE_BUILDONLY" \ > + -v CONFIGDIR="$CONFIGFRAG/" \ > + -v KVM="$KVM" \ > + -v ncpus=$cpus \ > + -v jitter="$jitter" \ > + -v rd=$resdir/$ds/ \ > + -v dur=$dur \ > + -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \ > + -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \ > +'BEGIN { > + i = 0; > +} > + > +{ > + cf[i] = $1; > + cpus[i] = $2; > + i++; > +} > + > +# Dump out the scripting required to run one test batch. > +function dump(first, pastlast, batchnum) > +{ > + print "echo ----Start batch " batchnum ": `date`"; > + print "echo ----Start batch " batchnum ": `date` >> " rd "/log"; > + jn=1 > + for (j = first; j < pastlast; j++) { > + builddir=KVM "/b" jn > + cpusr[jn] = cpus[j]; > + if (cfrep[cf[j]] == "") { > + cfr[jn] = cf[j]; > + cfrep[cf[j]] = 1; > + } else { > + cfrep[cf[j]]++; > + cfr[jn] = cf[j] "." cfrep[cf[j]]; > + } > + if (cpusr[jn] > ncpus && ncpus != 0) > + ovf = "-ovf"; > + else > + ovf = ""; > + print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`"; > + print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` >> " rd "/log"; > + print "rm -f " builddir ".*"; > + print "touch " builddir ".wait"; > + print "mkdir " builddir " > /dev/null 2>&1 || :"; > + print "mkdir " rd cfr[jn] " || :"; > + print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &" > + print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`"; > + print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log"; > + print "while test -f " builddir ".wait" > + print "do" > + print "\tsleep 1" > + print "done" > + print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date`"; > + print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` >> " rd "/log"; > + jn++; > + } > + for (j = 1; j < jn; j++) { > + builddir=KVM "/b" j > + print "rm -f " builddir ".ready" > + print "if test -z \"$TORTURE_BUILDONLY\"" > + print "then" > + print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date`"; > + print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date` >> " rd "/log"; > + print "fi" > + } > + njitter = 0; > + split(jitter, ja); > + if (ja[1] == -1 && ncpus == 0) > + njitter = 1; > + else if (ja[1] == -1) > + njitter = ncpus; > + else > + njitter = ja[1]; > + if (TORTURE_BUILDONLY && njitter != 0) { > + njitter = 0; > + print "echo Build-only run, so suppressing jitter >> " rd "/log" > + } > + for (j = 0; j < njitter; j++) > + print "jitter.sh " j " " dur " " ja[2] " " ja[3] "&" > + print "wait" > + print "if test -z \"$TORTURE_BUILDONLY\"" > + print "then" > + print "\techo ---- All kernel runs complete. `date`"; > + print "\techo ---- All kernel runs complete. `date` >> " rd "/log"; > + print "fi" > + for (j = 1; j < jn; j++) { > + builddir=KVM "/b" j > + print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results:"; > + print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: >> " rd "/log"; > + print "cat " rd cfr[j] "/kvm-test-1-run.sh.out"; > + print "cat " rd cfr[j] "/kvm-test-1-run.sh.out >> " rd "/log"; > + } > +} > + > +END { > + njobs = i; > + nc = ncpus; > + first = 0; > + batchnum = 1; > + > + # Each pass through the following loop considers one test. > + for (i = 0; i < njobs; i++) { > + if (ncpus == 0) { > + # Sequential test specified, each test its own batch. > + dump(i, i + 1, batchnum); > + first = i; > + batchnum++; > + } else if (nc < cpus[i] && i != 0) { > + # Out of CPUs, dump out a batch. > + dump(first, i, batchnum); > + first = i; > + nc = ncpus; > + batchnum++; > + } > + # Account for the CPUs needed by the current test. > + nc -= cpus[i]; > + } > + # Dump the last batch. > + if (ncpus != 0) > + dump(first, i, batchnum); > +}' >> $T/script > + > +cat << ___EOF___ >> $T/script > +echo > +echo > +echo " --- `date` Test summary:" > +echo Results directory: $resdir/$ds > +kvm-recheck.sh $resdir/$ds > +___EOF___ > + > +if test "$dryrun" = script > +then > + cat $T/script > + exit 0 > +elif test "$dryrun" = sched > +then > + # Extract the test run schedule from the script. > + egrep 'Start batch|Starting build\.' $T/script | > + grep -v ">>" | > + sed -e 's/:.*$//' -e 's/^echo //' > + exit 0 > +else > + # Not a dryrun, so run the script. > + sh $T/script > +fi > + > +# Tracing: trace_event=rcu:rcu_grace_period,rcu:rcu_future_grace_period,rcu:rcu_grace_period_init,rcu:rcu_nocb_wake,rcu:rcu_preempt_task,rcu:rcu_unlock_preempted_task,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_kfree_callback,rcu:rcu_batch_start,rcu:rcu_invoke_callback,rcu:rcu_invoke_kfree_callback,rcu:rcu_batch_end,rcu:rcu_torture_read,rcu:rcu_barrier > diff --git a/run-rcuperf.sh b/run-rcuperf.sh > new file mode 100755 > index 00000000..0526fff1 > --- /dev/null > +++ b/run-rcuperf.sh > @@ -0,0 +1,26 @@ > +#!/bin/bash > + > +dur=10 > +run=10 > +torture="rcuperf" > +rest="1m" > +path=`pwd` > + > +for cpu in 4 8 16 > +do > + for type in PRCU TREE > + do > + folder="$path/res/rcuperf/cpu-$cpu/$type" > + if ! test -d $folder > + then > + echo "$folder does not exist..." > + exit > + fi > + > + echo "Running rcuperf-$type-${cpu}cpus..." > + `./kvm.sh --torture $torture --duration $dur --configs ${run}*${type}-${cpu} --results $folder &> $folder/$type-cpu${cpu}-${dur}min.out` > + > + echo "Sleep $rest..." > + `sleep $rest` > + done > +done > -- > 2.14.1.729.g59c0ea183 >