* [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-04-29 0:24 [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 02/45] torture: Remove obsolete builddir options Paul E. McKenney
` (44 more replies)
2014-05-07 22:32 ` [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Josh Triplett
1 sibling, 45 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The rcutorture output currently does not distinguish between stalls in
the RCU implementation and stalls in the rcu_torture_writer() kthreads.
This commit therefore adds some diagnostics to help distinguish between
these two conditions, at least for the non-SRCU implementations. (SRCU
does not provide evidence of update-side forward progress by design.)
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/rcupdate.h | 19 +++++++++++++++++++
kernel/rcu/rcutorture.c | 37 +++++++++++++++++++++++++++++++++++++
kernel/rcu/tree.c | 18 ++++++++++++++++++
3 files changed, 74 insertions(+)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 00a7fd61b3c6..a6c3898e141e 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -51,7 +51,17 @@ extern int rcu_expedited; /* for sysctl */
extern int rcutorture_runnable; /* for sysctl */
#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
+enum rcutorture_type {
+ RTORT_BUSTED,
+ RTORT_RCU,
+ RTORT_RCU_BH,
+ RTORT_RCU_SCHED,
+ RTORT_SRCU
+};
+
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
+void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
+ unsigned long *gpnum, unsigned long *completed);
void rcutorture_record_test_transition(void);
void rcutorture_record_progress(unsigned long vernum);
void do_trace_rcu_torture_read(const char *rcutorturename,
@@ -60,6 +70,15 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
unsigned long c_old,
unsigned long c);
#else
+static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
+ int *flags,
+ unsigned long *gpnum,
+ unsigned long *completed)
+{
+ *flags = 0;
+ *gpnum = 0;
+ *completed = 0;
+}
static inline void rcutorture_record_test_transition(void)
{
}
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index bd30bc61bc05..1110db210318 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -138,6 +138,15 @@ static long n_barrier_attempts;
static long n_barrier_successes;
static struct list_head rcu_torture_removed;
+static int rcu_torture_writer_state;
+#define RTWS_FIXED_DELAY 0
+#define RTWS_DELAY 1
+#define RTWS_REPLACE 2
+#define RTWS_DEF_FREE 3
+#define RTWS_EXP_SYNC 4
+#define RTWS_STUTTER 5
+#define RTWS_STOPPING 6
+
#if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
#define RCUTORTURE_RUNNABLE_INIT 1
#else
@@ -214,6 +223,7 @@ rcu_torture_free(struct rcu_torture *p)
*/
struct rcu_torture_ops {
+ int ttype;
void (*init)(void);
int (*readlock)(void);
void (*read_delay)(struct torture_random_state *rrsp);
@@ -312,6 +322,7 @@ static void rcu_sync_torture_init(void)
}
static struct rcu_torture_ops rcu_ops = {
+ .ttype = RTORT_RCU,
.init = rcu_sync_torture_init,
.readlock = rcu_torture_read_lock,
.read_delay = rcu_read_delay,
@@ -355,6 +366,7 @@ static void rcu_bh_torture_deferred_free(struct rcu_torture *p)
}
static struct rcu_torture_ops rcu_bh_ops = {
+ .ttype = RTORT_RCU_BH,
.init = rcu_sync_torture_init,
.readlock = rcu_bh_torture_read_lock,
.read_delay = rcu_read_delay, /* just reuse rcu's version. */
@@ -397,6 +409,7 @@ call_rcu_busted(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
}
static struct rcu_torture_ops rcu_busted_ops = {
+ .ttype = RTORT_BUSTED,
.init = rcu_sync_torture_init,
.readlock = rcu_torture_read_lock,
.read_delay = rcu_read_delay, /* just reuse rcu's version. */
@@ -492,6 +505,7 @@ static void srcu_torture_synchronize_expedited(void)
}
static struct rcu_torture_ops srcu_ops = {
+ .ttype = RTORT_SRCU,
.init = rcu_sync_torture_init,
.readlock = srcu_torture_read_lock,
.read_delay = srcu_read_delay,
@@ -527,6 +541,7 @@ static void rcu_sched_torture_deferred_free(struct rcu_torture *p)
}
static struct rcu_torture_ops sched_ops = {
+ .ttype = RTORT_RCU_SCHED,
.init = rcu_sync_torture_init,
.readlock = sched_torture_read_lock,
.read_delay = rcu_read_delay, /* just reuse rcu's version. */
@@ -699,12 +714,15 @@ rcu_torture_writer(void *arg)
set_user_nice(current, MAX_NICE);
do {
+ rcu_torture_writer_state = RTWS_FIXED_DELAY;
schedule_timeout_uninterruptible(1);
rp = rcu_torture_alloc();
if (rp == NULL)
continue;
rp->rtort_pipe_count = 0;
+ rcu_torture_writer_state = RTWS_DELAY;
udelay(torture_random(&rand) & 0x3ff);
+ rcu_torture_writer_state = RTWS_REPLACE;
old_rp = rcu_dereference_check(rcu_torture_current,
current == writer_task);
rp->rtort_mbtest = 1;
@@ -721,8 +739,10 @@ rcu_torture_writer(void *arg)
else
exp = gp_exp;
if (!exp) {
+ rcu_torture_writer_state = RTWS_DEF_FREE;
cur_ops->deferred_free(old_rp);
} else {
+ rcu_torture_writer_state = RTWS_EXP_SYNC;
cur_ops->exp_sync();
list_add(&old_rp->rtort_free,
&rcu_torture_removed);
@@ -743,8 +763,10 @@ rcu_torture_writer(void *arg)
}
}
rcutorture_record_progress(++rcu_torture_current_version);
+ rcu_torture_writer_state = RTWS_STUTTER;
stutter_wait("rcu_torture_writer");
} while (!torture_must_stop());
+ rcu_torture_writer_state = RTWS_STOPPING;
torture_kthread_stopping("rcu_torture_writer");
return 0;
}
@@ -937,6 +959,7 @@ rcu_torture_printk(char *page)
int i;
long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
+ static unsigned long rtcv_snap = ULONG_MAX;
for_each_possible_cpu(cpu) {
for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
@@ -997,6 +1020,20 @@ rcu_torture_printk(char *page)
page += sprintf(page, "\n");
if (cur_ops->stats)
cur_ops->stats(page);
+ if (rtcv_snap == rcu_torture_current_version &&
+ rcu_torture_current != NULL) {
+ int __maybe_unused flags;
+ unsigned long __maybe_unused gpnum;
+ unsigned long __maybe_unused completed;
+
+ rcutorture_get_gp_data(cur_ops->ttype,
+ &flags, &gpnum, &completed);
+ page += sprintf(page,
+ "??? Writer stall state %d g%lu c%lu f%#x\n",
+ rcu_torture_writer_state,
+ gpnum, completed, flags);
+ }
+ rtcv_snap = rcu_torture_current_version;
}
/*
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0c47e300210a..032106df7391 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -294,6 +294,24 @@ void rcutorture_record_test_transition(void)
EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
/*
+ * Send along grace-period-related data for rcutorture diagnostics.
+ */
+void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
+ unsigned long *gpnum, unsigned long *completed)
+{
+ if (test_type == RTORT_SRCU || test_type == RTORT_BUSTED) {
+ *flags = 0;
+ *gpnum = 0;
+ *completed = 0;
+ return;
+ }
+ *flags = ACCESS_ONCE(rcu_state->gp_flags);
+ *gpnum = ACCESS_ONCE(rcu_state->gpnum);
+ *completed = ACCESS_ONCE(rcu_state->completed);
+}
+EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
+
+/*
* Record the number of writer passes through the current rcutorture test.
* This is also used to correlate debugfs tracing stats with the rcutorture
* messages.
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 02/45] torture: Remove obsolete builddir options
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 03/45] torture: Add batch headers "--dryrun sched" Paul E. McKenney
` (43 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The --builddir and --relbuilddir options were initially intended to handle
parallel tests. However, since commit 43e38ab3d518 (Enable concurrent
rcutorture runs), the script manages multiple build directories as
needed for parallel testing. This commit therefore removes these two
obsolete options.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 5a78cbf55f06..37a60ef70df3 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -38,7 +38,6 @@ dur=30
dryrun=""
KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
PATH=${KVM}/bin:$PATH; export PATH
-builddir="${KVM}/b1"
RCU_INITRD="$KVM/initrd"; export RCU_INITRD
RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
TORTURE_SUITE=rcu
@@ -53,7 +52,6 @@ kversion=""
usage () {
echo "Usage: $scriptname optional arguments:"
echo " --bootargs kernel-boot-arguments"
- echo " --builddir absolute-pathname"
echo " --buildonly"
echo " --configs \"config-file list\""
echo " --cpus N"
@@ -67,7 +65,6 @@ usage () {
echo " --no-initrd"
echo " --qemu-args qemu-system-..."
echo " --qemu-cmd qemu-system-..."
- echo " --relbuilddir relative-pathname"
echo " --results absolute-pathname"
echo " --torture rcu"
exit 1
@@ -81,12 +78,6 @@ do
RCU_BOOTARGS="$2"
shift
;;
- --builddir)
- checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' '^error'
- builddir=$2
- gotbuilddir=1
- shift
- ;;
--buildonly)
RCU_BUILDONLY=1; export RCU_BUILDONLY
;;
@@ -146,13 +137,6 @@ do
RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD
shift
;;
- --relbuilddir)
- checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
- relbuilddir=$2
- gotrelbuilddir=1
- builddir=${KVM}/${relbuilddir}
- shift
- ;;
--results)
checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
resdir=$2
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 03/45] torture: Add batch headers "--dryrun sched"
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 02/45] torture: Remove obsolete builddir options Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 04/45] torture: Make parse-rcutorture.sh less RCU-specific Paul E. McKenney
` (42 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the output of "--dryrun sched" more user-friendly,
clearly indicating the batch starts.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 37a60ef70df3..740676255c6a 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -379,7 +379,8 @@ then
elif test "$dryrun" = sched
then
# Extract the test run schedule from the script.
- egrep 'start batch|Starting build\.' $T/script |
+ egrep 'Start batch|Starting build\.' $T/script |
+ grep -v ">>" |
sed -e 's/:.*$//' -e 's/^echo //'
exit 0
else
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 04/45] torture: Make parse-rcutorture.sh less RCU-specific
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 02/45] torture: Remove obsolete builddir options Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 03/45] torture: Add batch headers "--dryrun sched" Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 05/45] torture: Rename RCU_INITRD to TORTURE_INITRD Paul E. McKenney
` (41 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
It can be a bit jarring to see a locking test complain about RCU, so
this commit renames parse-rcutorture.sh to parse-torture.sh and makes
the messages it emits more generic.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
.../selftests/rcutorture/bin/kvm-recheck.sh | 2 +-
.../selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
.../selftests/rcutorture/bin/parse-rcutorture.sh | 106 ---------------------
.../selftests/rcutorture/bin/parse-torture.sh | 106 +++++++++++++++++++++
4 files changed, 108 insertions(+), 108 deletions(-)
delete mode 100755 tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
create mode 100755 tools/testing/selftests/rcutorture/bin/parse-torture.sh
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index a44daaa259a9..26d78b7eaccf 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -41,7 +41,7 @@ do
kvm-recheck-${TORTURE_SUITE}.sh $i
configcheck.sh $i/.config $i/ConfigFragment
parse-build.sh $i/Make.out $configfile
- parse-rcutorture.sh $i/console.log $configfile
+ parse-torture.sh $i/console.log $configfile
parse-console.sh $i/console.log $configfile
if test -r $i/Warnings
then
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 94b28bb37d36..e82f4f201c8c 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -199,5 +199,5 @@ then
fi
cp $builddir/console.log $resdir
-parse-${TORTURE_SUITE}torture.sh $resdir/console.log $title
+parse-torture.sh $resdir/console.log $title
parse-console.sh $resdir/console.log $title
diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
deleted file mode 100755
index dd0a275d9796..000000000000
--- a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-#
-# Check the console output from an rcutorture run for goodness.
-# The "file" is a pathname on the local system, and "title" is
-# a text string for error-message purposes.
-#
-# The file must contain rcutorture output, but can be interspersed
-# with other dmesg text.
-#
-# Usage:
-# sh parse-rcutorture.sh file title
-#
-# 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 <paulmck@linux.vnet.ibm.com>
-
-T=/tmp/parse-rcutorture.sh.$$
-file="$1"
-title="$2"
-
-trap 'rm -f $T.seq' 0
-
-. functions.sh
-
-# check for presence of rcutorture.txt file
-
-if test -f "$file" -a -r "$file"
-then
- :
-else
- echo $title unreadable rcutorture.txt file: $file
- exit 1
-fi
-
-# check for abject failure
-
-if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
-then
- nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
- print_bug $title FAILURE, $nerrs instances
- echo " " $url
- exit
-fi
-
-grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
-awk '
-BEGIN {
- ver = 0;
- badseq = 0;
- }
-
- {
- if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
- badseqno1 = ver;
- badseqno2 = $5;
- badseqnr = NR;
- badseq = 1;
- }
- ver = $5
- }
-
-END {
- if (badseq) {
- if (badseqno1 == badseqno2 && badseqno2 == ver)
- print "RCU GP HANG at " ver " rcutorture stat " badseqnr;
- else
- print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr;
- }
- }' > $T.seq
-
-if grep -q SUCCESS $file
-then
- if test -s $T.seq
- then
- print_warning $title $title `cat $T.seq`
- echo " " $file
- exit 2
- fi
-else
- if grep -q RCU_HOTPLUG $file
- then
- print_warning HOTPLUG FAILURES $title `cat $T.seq`
- echo " " $file
- exit 3
- fi
- echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
- if test -s $T.seq
- then
- print_warning $title `cat $T.seq`
- fi
- exit 2
-fi
diff --git a/tools/testing/selftests/rcutorture/bin/parse-torture.sh b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
new file mode 100755
index 000000000000..3455560ab4e4
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
@@ -0,0 +1,106 @@
+#!/bin/sh
+#
+# Check the console output from a torture run for goodness.
+# The "file" is a pathname on the local system, and "title" is
+# a text string for error-message purposes.
+#
+# The file must contain torture output, but can be interspersed
+# with other dmesg text, as in console-log output.
+#
+# Usage:
+# sh parse-torture.sh file title
+#
+# 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 <paulmck@linux.vnet.ibm.com>
+
+T=/tmp/parse-torture.sh.$$
+file="$1"
+title="$2"
+
+trap 'rm -f $T.seq' 0
+
+. functions.sh
+
+# check for presence of torture output file.
+
+if test -f "$file" -a -r "$file"
+then
+ :
+else
+ echo $title unreadable torture output file: $file
+ exit 1
+fi
+
+# check for abject failure
+
+if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
+then
+ nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
+ print_bug $title FAILURE, $nerrs instances
+ echo " " $url
+ exit
+fi
+
+grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
+awk '
+BEGIN {
+ ver = 0;
+ badseq = 0;
+ }
+
+ {
+ if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
+ badseqno1 = ver;
+ badseqno2 = $5;
+ badseqnr = NR;
+ badseq = 1;
+ }
+ ver = $5
+ }
+
+END {
+ if (badseq) {
+ if (badseqno1 == badseqno2 && badseqno2 == ver)
+ print "GP HANG at " ver " torture stat " badseqnr;
+ else
+ print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " version " badseqnr;
+ }
+ }' > $T.seq
+
+if grep -q SUCCESS $file
+then
+ if test -s $T.seq
+ then
+ print_warning $title $title `cat $T.seq`
+ echo " " $file
+ exit 2
+ fi
+else
+ if grep -q "_HOTPLUG:" $file
+ then
+ print_warning HOTPLUG FAILURES $title `cat $T.seq`
+ echo " " $file
+ exit 3
+ fi
+ echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful version messages
+ if test -s $T.seq
+ then
+ print_warning $title `cat $T.seq`
+ fi
+ exit 2
+fi
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 05/45] torture: Rename RCU_INITRD to TORTURE_INITRD
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (2 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 04/45] torture: Make parse-rcutorture.sh less RCU-specific Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 06/45] torture: Intensify locking test Paul E. McKenney
` (40 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 197901ec10bf..d8e68a5e4411 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -47,7 +47,7 @@ mkdir $T
cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config
cat << ___EOF___ >> $T/config
-CONFIG_INITRAMFS_SOURCE="$RCU_INITRD"
+CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_CONSOLE=y
___EOF___
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 740676255c6a..a52a077ee258 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -38,7 +38,7 @@ dur=30
dryrun=""
KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
PATH=${KVM}/bin:$PATH; export PATH
-RCU_INITRD="$KVM/initrd"; export RCU_INITRD
+TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
TORTURE_SUITE=rcu
resdir=""
@@ -125,7 +125,7 @@ do
shift
;;
--no-initrd)
- RCU_INITRD=""; export RCU_INITRD
+ TORTURE_INITRD=""; export TORTURE_INITRD
;;
--qemu-args)
checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
@@ -367,7 +367,7 @@ then
echo KVPATH="$KVPATH; export KVPATH"
echo PATH="$PATH; export PATH"
echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
- echo RCU_INITRD="$RCU_INITRD; export RCU_INITRD"
+ echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG"
echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 06/45] torture: Intensify locking test
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (3 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 05/45] torture: Rename RCU_INITRD to TORTURE_INITRD Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-05-07 21:20 ` josh
2014-04-29 0:24 ` [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified Paul E. McKenney
` (39 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The current lock_torture_writer() spends too much time sleeping and not
enough time hammering locks, as in an eight-CPU test will often only be
utilizing a CPU or two. This commit therefore makes lock_torture_writer()
sleep less and hammer more.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/locking/locktorture.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index f26b1a18e34e..b0d3e3c50672 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg)
set_user_nice(current, 19);
do {
- schedule_timeout_uninterruptible(1);
+ if ((torture_random(&rand) & 0xfffff) == 0)
+ schedule_timeout_uninterruptible(1);
cur_ops->writelock();
if (WARN_ON_ONCE(lock_is_write_held))
lwsp->n_write_lock_fail++;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16
@ 2014-04-29 0:24 Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
2014-05-07 22:32 ` [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Josh Triplett
0 siblings, 2 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw
Hello!
This series provides torture-test updates:
1. Add forward-progress checking to distinguish between stalls in
the RCU implementation and in the torture test itself.
2. Remove the --builddir and --relbuilddir options, which have been
obsoleted by the parallel testing facility.
3. Make "--dryrun sched" output more readable by clearly indicating
where each batch of concurrent runs starts.
4. Make torture-test errors less RCU-specific. ("Hey, why did
my locktorture run complain about RCU???")
5,8-14. Rename variables to reflect the new RCU-independence of a number
of the torture-test scripts.
6. Reduce locktorture sleeping to increase intensity.
7. Add a --defconfig argument to allow other default configs to
be specified.
15. Make config-fragment filtering RCU-independent.
16. Mark private functions as static in kernel/rcu/torture.c,
courtesy of Rashika Kheria.
17-18. Make the output of "--dryrun script" independently runnable.
19. Print negative numbers when SRCU counters wrap instead of
huge 64-bit integers.
20. Fix "Stopping" torture messages.
21. Report any diagnostics issued by qemu.
22. Make kthreads spin during the last jiffy of a stutter period
to increase the intensity of torture stop-start events.
23. Permit multiple qemu and boot arguments to be specified on
the command line.
24. Choose bzImage location based on architecture.
25. Add tracing-enabled variant of TREE02 to aid debugging.
26. Dump the ftrace buffer when the RCU grace period stalls.
27. Export the RCU grace-period kthread wait state to rcutorture
to ease diagnosis of RCU grace-period stalls.
28. Fix bug in raw_cpu_inc_return().
29. Make cond_resched() report RCU quiescent states.
30. Make rcu_torture_reader() use cond_resched() instead of
unconditionally invoking schedule().
31. Complain if an all-zero cpumask is specified during a torture
shuffle operation, courtesy of Iulia Manda.
32. Make build failures more evident.
33. Capture and report the torture_create_kthread() return value when
creating the rcu_torture_fqs kthread.
34. Use elapsed time to detect hangs rather than counting "sleep 1"
commands.
35. Rearrange config fragments to ensure that RCU-sched primitives are
tested in TREE_PREEMPT_RCU kernels.
36. Add rcutorture tests for get_state_synchronize_rcu() and
cond_synchronize_rcu().
37. Add explicit tests for synchronous grace-period primitives.
38. Add missing destroy_timer_on_stack(), courtesy of Thomas Gleixner.
39. Make scripts record "git diff HEAD" to ease reproduction of
an unexpected torture-test result.
40. Run rcu_torture_writer() at normal priority.
41. Put the qemu process into the background to better handle
kernel hangs.
42. Remove reference to a non-existent Kconfig parameter.
43. Refuse to run multiple concurrent torture tests.
44. Remove __init from torture_init_begin() and torture_init_end()
to allow rcutorture to once again work as a loadable module.
45. Remove unused torture_parm() macro.
Thanx, Paul
------------------------------------------------------------------------
b/include/linux/percpu.h | 2
b/include/linux/rcupdate.h | 19 +
b/include/linux/rcutiny.h | 4
b/include/linux/rcutree.h | 1
b/include/linux/torture.h | 2
b/kernel/locking/locktorture.c | 3
b/kernel/rcu/rcutorture.c | 37 ++
b/kernel/rcu/tree.c | 18 +
b/kernel/rcu/tree.h | 8
b/kernel/rcu/update.c | 18 +
b/kernel/sched/core.c | 7
b/kernel/torture.c | 5
b/tools/testing/selftests/rcutorture/bin/configinit.sh | 2
b/tools/testing/selftests/rcutorture/bin/functions.sh | 12
b/tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2
b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh | 2
b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2
b/tools/testing/selftests/rcutorture/bin/kvm.sh | 16
b/tools/testing/selftests/rcutorture/bin/parse-torture.sh | 106 ++++++
b/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T | 25 +
b/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot | 1
include/linux/rcupdate.h | 36 ++
include/linux/torture.h | 6
kernel/locking/locktorture.c | 7
kernel/rcu/rcutorture.c | 193 +++++++----
kernel/rcu/tree.c | 17
kernel/torture.c | 36 +-
tools/testing/selftests/rcutorture/bin/functions.sh | 35 +
tools/testing/selftests/rcutorture/bin/kvm-build.sh | 4
tools/testing/selftests/rcutorture/bin/kvm-recheck.sh | 24 +
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 44 +-
tools/testing/selftests/rcutorture/bin/kvm.sh | 162 +++++----
tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh | 106 ------
35 files changed, 649 insertions(+), 317 deletions(-)
^ permalink raw reply [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (4 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 06/45] torture: Intensify locking test Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-05-07 21:22 ` josh
2014-04-29 0:24 ` [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG Paul E. McKenney
` (38 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Some environments require some variation on "make defconfig" to initialize
the .config file. This commit therefore adds a --defconfig argument to
allow this to be specified. The default value is of course "defconfig".
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/configinit.sh | 2 +-
tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
index a1be6e62add1..9c3f3d39b934 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -62,7 +62,7 @@ grep '^grep' < $T/u.sh > $T/upd.sh
echo "cat - $c" >> $T/upd.sh
make mrproper
make $buildloc distclean > $builddir/Make.distclean 2>&1
-make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1
+make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
mv $builddir/.config $builddir/.config.sav
sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
cp $builddir/.config $builddir/.config.new
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index a52a077ee258..59945b7793d9 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -38,6 +38,7 @@ dur=30
dryrun=""
KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
PATH=${KVM}/bin:$PATH; export PATH
+TORTURE_DEFCONFIG=defconfig
TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
TORTURE_SUITE=rcu
@@ -56,6 +57,7 @@ usage () {
echo " --configs \"config-file list\""
echo " --cpus N"
echo " --datestamp string"
+ echo " --defconfig string"
echo " --dryrun sched|script"
echo " --duration minutes"
echo " --interactive"
@@ -96,6 +98,11 @@ do
ds=$2
shift
;;
+ --defconfig)
+ checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
+ TORTURE_DEFCONFIG=$2
+ shift
+ ;;
--dryrun)
checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
dryrun=$2
@@ -259,6 +266,7 @@ END {
# Generate a script to execute the tests in appropriate batches.
cat << ___EOF___ > $T/script
TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
+TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
___EOF___
awk < $T/cfgcpu.pack \
-v CONFIGDIR="$CONFIGFRAG/$kversion/" \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (5 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-05-07 21:23 ` josh
2014-04-29 0:24 ` [PATCH tip/core/rcu 09/45] torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGS Paul E. McKenney
` (37 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index d8e68a5e4411..e838c775f709 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -60,7 +60,7 @@ then
exit 2
fi
ncpus=`cpus2use.sh`
-make O=$builddir -j$ncpus $RCU_KMAKE_ARG > $builddir/Make.out 2>&1
+make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $builddir/Make.out 2>&1
retval=$?
if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 59945b7793d9..04ad1f980dfe 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -40,7 +40,7 @@ KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
PATH=${KVM}/bin:$PATH; export PATH
TORTURE_DEFCONFIG=defconfig
TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
-RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
+TORTURE_KMAKE_ARG=""
TORTURE_SUITE=rcu
resdir=""
configs=""
@@ -118,7 +118,7 @@ do
;;
--kmake-arg)
checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
- RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
+ TORTURE_KMAKE_ARG="$2"
shift
;;
--kversion)
@@ -376,7 +376,7 @@ then
echo PATH="$PATH; export PATH"
echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
- echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG"
+ echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 09/45] torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGS
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (6 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY Paul E. McKenney
` (36 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 04ad1f980dfe..08c90cba79d2 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -77,7 +77,7 @@ do
case "$1" in
--bootargs)
checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
- RCU_BOOTARGS="$2"
+ TORTURE_BOOTARGS="$2"
shift
;;
--buildonly)
@@ -275,7 +275,7 @@ awk < $T/cfgcpu.pack \
-v rd=$resdir/$ds/ \
-v dur=$dur \
-v RCU_QEMU_ARG=$RCU_QEMU_ARG \
- -v RCU_BOOTARGS=$RCU_BOOTARGS \
+ -v TORTURE_BOOTARGS=$TORTURE_BOOTARGS \
'BEGIN {
i = 0;
}
@@ -312,7 +312,7 @@ function dump(first, pastlast)
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 " \"" RCU_QEMU_ARG "\" \"" RCU_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
+ print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" RCU_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"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (7 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 09/45] torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGS Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-05-07 21:24 ` josh
2014-04-29 0:24 ` [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE Paul E. McKenney
` (35 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
tools/testing/selftests/rcutorture/bin/kvm.sh | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
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 e82f4f201c8c..86e6ffe6df45 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -152,7 +152,7 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
-if test -n "$RCU_BUILDONLY"
+if test -n "$TORTURE_BUILDONLY"
then
echo Build-only run specified, boot/test omitted.
exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 08c90cba79d2..73c586f6bdf6 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -81,7 +81,7 @@ do
shift
;;
--buildonly)
- RCU_BUILDONLY=1; export RCU_BUILDONLY
+ TORTURE_BUILDONLY=1
;;
--configs)
checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
@@ -374,7 +374,7 @@ then
echo KVM="$KVM; export KVM"
echo KVPATH="$KVPATH; export KVPATH"
echo PATH="$PATH; export PATH"
- echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
+ echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
@@ -402,4 +402,7 @@ echo
echo
echo " --- `date` Test summary:"
echo Results directory: $resdir/$ds
-kvm-recheck.sh $resdir/$ds
+if test -n "$TORTURE_BUILDONLY"
+then
+ kvm-recheck.sh $resdir/$ds
+fi
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (8 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY Paul E. McKenney
@ 2014-04-29 0:24 ` Paul E. McKenney
2014-05-07 21:26 ` josh
2014-05-07 21:27 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC Paul E. McKenney
` (34 subsequent siblings)
44 siblings, 2 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:24 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/functions.sh | 12 ++++++------
tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++--
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 9b17e810ddc3..623939cf814e 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -107,14 +107,14 @@ identify_qemu () {
# identify_qemu_append qemu-cmd
#
# Output arguments for the qemu "-append" string based on CPU type
-# and the RCU_QEMU_INTERACTIVE environment variable.
+# and the TORTURE_QEMU_INTERACTIVE environment variable.
identify_qemu_append () {
case "$1" in
qemu-system-x86_64|qemu-system-i386)
echo noapic selinux=0 initcall_debug debug
;;
esac
- if test -n "$RCU_QEMU_INTERACTIVE"
+ if test -n "$TORTURE_QEMU_INTERACTIVE"
then
echo root=/dev/sda
else
@@ -125,7 +125,7 @@ identify_qemu_append () {
# identify_qemu_args qemu-cmd serial-file
#
# Output arguments for qemu arguments based on the RCU_QEMU_MAC
-# and RCU_QEMU_INTERACTIVE environment variables.
+# and TORTURE_QEMU_INTERACTIVE environment variables.
identify_qemu_args () {
case "$1" in
qemu-system-x86_64|qemu-system-i386)
@@ -133,17 +133,17 @@ identify_qemu_args () {
qemu-system-ppc64)
echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
echo -device spapr-vscsi
- if test -n "$RCU_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
+ if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
then
echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
echo -netdev bridge,br=br0,id=net0
- elif test -n "$RCU_QEMU_INTERACTIVE"
+ elif test -n "$TORTURE_QEMU_INTERACTIVE"
then
echo -net nic -net user
fi
;;
esac
- if test -n "$RCU_QEMU_INTERACTIVE"
+ if test -n "$TORTURE_QEMU_INTERACTIVE"
then
echo -monitor stdio -serial pty -S
else
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 73c586f6bdf6..2f9605ed5b58 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -114,7 +114,7 @@ do
shift
;;
--interactive)
- RCU_QEMU_INTERACTIVE=1; export RCU_QEMU_INTERACTIVE
+ TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE
;;
--kmake-arg)
checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
@@ -378,7 +378,8 @@ then
echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
- echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
+ echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
+ export TORTURE_QEMU_INTERACTIVE"
echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
echo "mkdir -p "$resdir" || :"
echo "mkdir $resdir/$ds"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (9 preceding siblings ...)
2014-04-29 0:24 ` [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:27 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 13/45] torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARG Paul E. McKenney
` (33 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/functions.sh | 6 +++---
tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 623939cf814e..41fb52b805e4 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -124,7 +124,7 @@ identify_qemu_append () {
# identify_qemu_args qemu-cmd serial-file
#
-# Output arguments for qemu arguments based on the RCU_QEMU_MAC
+# Output arguments for qemu arguments based on the TORTURE_QEMU_MAC
# and TORTURE_QEMU_INTERACTIVE environment variables.
identify_qemu_args () {
case "$1" in
@@ -133,9 +133,9 @@ identify_qemu_args () {
qemu-system-ppc64)
echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
echo -device spapr-vscsi
- if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
+ if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$TORTURE_QEMU_MAC"
then
- echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
+ echo -device spapr-vlan,netdev=net0,mac=$TORTURE_QEMU_MAC
echo -netdev bridge,br=br0,id=net0
elif test -n "$TORTURE_QEMU_INTERACTIVE"
then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 2f9605ed5b58..1a4a68c76914 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -128,7 +128,7 @@ do
;;
--mac)
checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
- RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
+ TORTURE_QEMU_MAC=$2; export TORTURE_QEMU_MAC
shift
;;
--no-initrd)
@@ -380,7 +380,7 @@ then
echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
export TORTURE_QEMU_INTERACTIVE"
- echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
+ echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
echo "mkdir -p "$resdir" || :"
echo "mkdir $resdir/$ds"
cat $T/script
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 13/45] torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARG
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (10 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 14/45] torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMD Paul E. McKenney
` (32 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 1a4a68c76914..d397ecc55293 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -136,7 +136,7 @@ do
;;
--qemu-args)
checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
- RCU_QEMU_ARG="$2"
+ TORTURE_QEMU_ARG="$2"
shift
;;
--qemu-cmd)
@@ -274,7 +274,7 @@ awk < $T/cfgcpu.pack \
-v ncpus=$cpus \
-v rd=$resdir/$ds/ \
-v dur=$dur \
- -v RCU_QEMU_ARG=$RCU_QEMU_ARG \
+ -v TORTURE_QEMU_ARG=$TORTURE_QEMU_ARG \
-v TORTURE_BOOTARGS=$TORTURE_BOOTARGS \
'BEGIN {
i = 0;
@@ -312,7 +312,7 @@ function dump(first, pastlast)
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 " \"" RCU_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
+ 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"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 14/45] torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMD
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (11 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 13/45] torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARG Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent Paul E. McKenney
` (31 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit makes the torture scripts a bit more RCU-independent.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/functions.sh | 8 ++++----
tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 41fb52b805e4..6b2adb29b073 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -79,12 +79,12 @@ configfrag_hotplug_cpu () {
# identify_qemu builddir
#
# Returns our best guess as to which qemu command is appropriate for
-# the kernel at hand. Override with the RCU_QEMU_CMD environment variable.
+# the kernel at hand. Override with the TORTURE_QEMU_CMD environment variable.
identify_qemu () {
local u="`file "$1"`"
- if test -n "$RCU_QEMU_CMD"
+ if test -n "$TORTURE_QEMU_CMD"
then
- echo $RCU_QEMU_CMD
+ echo $TORTURE_QEMU_CMD
elif echo $u | grep -q x86-64
then
echo qemu-system-x86_64
@@ -98,7 +98,7 @@ identify_qemu () {
echo Cannot figure out what qemu command to use! 1>&2
echo file $1 output: $u
# Usually this will be one of /usr/bin/qemu-system-*
- # Use RCU_QEMU_CMD environment variable or appropriate
+ # Use TORTURE_QEMU_CMD environment variable or appropriate
# argument to top-level script.
exit 1
fi
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index d397ecc55293..ea59e2950f14 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -141,7 +141,7 @@ do
;;
--qemu-cmd)
checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
- RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD
+ TORTURE_QEMU_CMD="$2"; export TORTURE_QEMU_CMD
shift
;;
--results)
@@ -377,7 +377,7 @@ then
echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
- echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
+ echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD"
echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
export TORTURE_QEMU_INTERACTIVE"
echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (12 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 14/45] torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMD Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:29 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 16/45] rcutorture: Mark function as static in kernel/rcu/torture.c Paul E. McKenney
` (30 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The torture tests need to set specific values for their respective
Kconfig options (e.g., CONFIG_LOCK_TORTURE_TEST), and must therefore
filter any conflicting definitions from the Kconfig fragment
file. Unfortunately, the code in kvm-build.sh was looking only for
CONFIG_RCU_TORTURE_TEST. This commit therefore handles the general case
of CONFIG_[A-Z]*TORTURE_TEST.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index e838c775f709..6d0b76d918f4 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -45,7 +45,7 @@ T=/tmp/test-linux.sh.$$
trap 'rm -rf $T' 0
mkdir $T
-cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config
+cat ${config_template} | grep -v 'CONFIG_[A-Z]*_TORTURE_TEST' > $T/config
cat << ___EOF___ >> $T/config
CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
CONFIG_VIRTIO_PCI=y
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 16/45] rcutorture: Mark function as static in kernel/rcu/torture.c
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (13 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 17/45] torture: Make "--dryrun script" output self-sufficient Paul E. McKenney
` (29 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Rashika Kheria, Paul E. McKenney
From: Rashika Kheria <rashika.kheria@gmail.com>
Mark functions as static in kernel/rcu/torture.c because they are not
used outside this file.
This eliminates the following warning in kernel/rcu/torture.c:
kernel/rcu/torture.c:902:6: warning: no previous prototype for ‘rcutorture_trace_dump’ [-Wmissing-prototypes]
kernel/rcu/torture.c:1572:6: warning: no previous prototype for ‘rcu_torture_barrier_cbf’ [-Wmissing-prototypes]
Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 1110db210318..3845ea99ccd4 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -806,7 +806,7 @@ rcu_torture_fakewriter(void *arg)
return 0;
}
-void rcutorture_trace_dump(void)
+static void rcutorture_trace_dump(void)
{
static atomic_t beenhere = ATOMIC_INIT(0);
@@ -1183,7 +1183,7 @@ static int __init rcu_torture_stall_init(void)
}
/* Callback function for RCU barrier testing. */
-void rcu_torture_barrier_cbf(struct rcu_head *rcu)
+static void rcu_torture_barrier_cbf(struct rcu_head *rcu)
{
atomic_inc(&barrier_cbs_invoked);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 17/45] torture: Make "--dryrun script" output self-sufficient
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (14 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 16/45] rcutorture: Mark function as static in kernel/rcu/torture.c Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run Paul E. McKenney
` (28 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The scripts produced by kvm.sh's "--dryrun script" argument were intended
for debugging rather than to run, but it is easier to debug if the script
output matches exactly what is run. This commit therefore makes this
script runnable.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 60 ++++++++++++---------------
1 file changed, 27 insertions(+), 33 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index ea59e2950f14..8aa62a2dccb5 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -175,30 +175,6 @@ then
resdir=$KVM/res
fi
-if test "$dryrun" = ""
-then
- if ! test -e $resdir
- then
- mkdir -p "$resdir" || :
- fi
- mkdir $resdir/$ds
-
- # Be noisy only if running the script.
- 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
- fi
-fi
-
# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
touch $T/cfgcpu
for CF in $configs
@@ -267,6 +243,22 @@ END {
cat << ___EOF___ > $T/script
TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
+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
+fi
___EOF___
awk < $T/cfgcpu.pack \
-v CONFIGDIR="$CONFIGFRAG/$kversion/" \
@@ -366,6 +358,17 @@ END {
dump(first, i);
}' >> $T/script
+cat << ___EOF___ >> $T/script
+echo
+echo
+echo " --- `date` Test summary:"
+echo Results directory: $resdir/$ds
+if test -z "$TORTURE_BUILDONLY"
+then
+ kvm-recheck.sh $resdir/$ds
+fi
+___EOF___
+
if test "$dryrun" = script
then
# Dump out the script, but define the environment variables that
@@ -398,12 +401,3 @@ else
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
-
-echo
-echo
-echo " --- `date` Test summary:"
-echo Results directory: $resdir/$ds
-if test -n "$TORTURE_BUILDONLY"
-then
- kvm-recheck.sh $resdir/$ds
-fi
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (15 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 17/45] torture: Make "--dryrun script" output self-sufficient Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:33 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound Paul E. McKenney
` (27 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
In a normal torture-test run, the script inherits its environment
variables, but this does not work when producing a script that is
to run later. Therefore, definitions and exports are prepended to
a dryrun script but not to a script that is run immediately. This
commit reconciles this by placing definitions and exports at the
beginning of the script in both cases.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 28 ++++++++++++---------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 8aa62a2dccb5..93a6c5a8517d 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -241,8 +241,19 @@ END {
# Generate a script to execute the tests in appropriate batches.
cat << ___EOF___ > $T/script
-TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
+CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
+KVM="$KVM"; export KVM
+KVPATH="$KVPATH"; export KVPATH
+PATH="$PATH"; export PATH
+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_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
if ! test -e $resdir
then
mkdir -p "$resdir" || :
@@ -371,21 +382,6 @@ ___EOF___
if test "$dryrun" = script
then
- # Dump out the script, but define the environment variables that
- # it needs to run standalone.
- echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
- echo KVM="$KVM; export KVM"
- echo KVPATH="$KVPATH; export KVPATH"
- echo PATH="$PATH; export PATH"
- echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
- echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
- echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
- echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD"
- echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
- export TORTURE_QEMU_INTERACTIVE"
- echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
- echo "mkdir -p "$resdir" || :"
- echo "mkdir $resdir/$ds"
cat $T/script
exit 0
elif test "$dryrun" = sched
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (16 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:34 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping() Paul E. McKenney
` (26 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The srcu_torture_stats() function prints SRCU's per-CPU c[] array with
an unsigned format, which means that the number one less than zero is
a very large number. This commit therefore prints this array with a
signed format in order to improve readability of the rcutorture output.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 3845ea99ccd4..0141fcff6bb9 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -486,15 +486,16 @@ static void srcu_torture_barrier(void)
static void srcu_torture_stats(char *page)
{
+ long c0, c1;
int cpu;
int idx = srcu_ctl.completed & 0x1;
page += sprintf(page, "%s%s per-CPU(idx=%d):",
torture_type, TORTURE_FLAG, idx);
for_each_possible_cpu(cpu) {
- page += sprintf(page, " %d(%lu,%lu)", cpu,
- per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx],
- per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]);
+ c0 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx];
+ c1 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx];
+ page += sprintf(page, " %d(%ld,%ld)", cpu, c0, c1);
}
sprintf(page, "\n");
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (17 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:37 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu Paul E. McKenney
` (25 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Currently, torture_kthread_stopping() prints only the name of the
kthread that is stopping, which can be unedifying. This commit therefore
adds "Stopping" to make things more evident.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/torture.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/torture.c b/kernel/torture.c
index acc9afc2f26e..f329848c3eee 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
*/
void torture_kthread_stopping(char *title)
{
+ char buf[128];
+
+ snprintf(buf, sizeof(buf), "Stopping %s", title);
if (verbose)
- VERBOSE_TOROUT_STRING(title);
+ VERBOSE_TOROUT_STRING(buf);
while (!kthread_should_stop()) {
torture_shutdown_absorb(title);
schedule_timeout_uninterruptible(1);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (18 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping() Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:59 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 22/45] torture: Increase stutter-end intensity Paul E. McKenney
` (24 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The current script does record qemu diagnostics, but the user has to
know where to look for them. This commit therefore puts them into the
Warnings file so that kvm-recheck.sh will display them. This change is
especially useful if you are in the habit of killing the qemu process
when you realize that you messed something up, but then later on wonder
why the process terminated early.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
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 86e6ffe6df45..7848227aa4c1 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -157,7 +157,7 @@ then
echo Build-only run specified, boot/test omitted.
exit 0
fi
-$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args" &
+$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
qemu_pid=$!
commandcompleted=0
echo Monitoring qemu job at pid $qemu_pid
@@ -172,6 +172,14 @@ do
if test $kruntime -lt $seconds
then
echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
+ grep "^(qemu) qemu:" $resdir/kvm-test-1-run.sh.out >> $resdir/Warnings 2>&1
+ killpid="`grep "^(qemu) qemu: terminating on signal [0-9]* from pid" $resdir/kvm-test-1-run.sh.out`"
+ if test -n "$killpid"
+ then
+ pscmd="`echo $killpid | sed -e 's/^.*from pid/ps -ef | grep/'`"
+ echo $pscmd >> $resdir/Warnings
+ echo $pscmd | sh >> $resdir/Warnings 2>&1
+ fi
else
echo ' ---' `date`: Kernel done
fi
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 22/45] torture: Increase stutter-end intensity
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (19 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 23/45] torture: Permit multi-word qemu and boot arguments Paul E. McKenney
` (23 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Currently, all stuttered kthreads block a jiffy at a time, which can
result in them starting at different times. (Note: This is not an
energy-efficiency problem unless you run torture tests in production,
in which case you have other problems!) This commit increases the
intensity of the restart event by causing kthreads to spin through the
last jiffy, restarting when they see the variable change.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/torture.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/torture.c b/kernel/torture.c
index f329848c3eee..bd768effba9a 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -533,7 +533,11 @@ void stutter_wait(const char *title)
while (ACCESS_ONCE(stutter_pause_test) ||
(torture_runnable && !ACCESS_ONCE(*torture_runnable))) {
if (stutter_pause_test)
- schedule_timeout_interruptible(1);
+ if (ACCESS_ONCE(stutter_pause_test) == 1)
+ schedule_timeout_interruptible(1);
+ else
+ while (ACCESS_ONCE(stutter_pause_test))
+ cond_resched();
else
schedule_timeout_interruptible(round_jiffies_relative(HZ));
torture_shutdown_absorb(title);
@@ -550,7 +554,11 @@ static int torture_stutter(void *arg)
VERBOSE_TOROUT_STRING("torture_stutter task started");
do {
if (!torture_must_stop()) {
- schedule_timeout_interruptible(stutter);
+ if (stutter > 1) {
+ schedule_timeout_interruptible(stutter - 1);
+ ACCESS_ONCE(stutter_pause_test) = 2;
+ }
+ schedule_timeout_interruptible(1);
ACCESS_ONCE(stutter_pause_test) = 1;
}
if (!torture_must_stop())
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 23/45] torture: Permit multi-word qemu and boot arguments
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (20 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 22/45] torture: Increase stutter-end intensity Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture Paul E. McKenney
` (22 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit applies quotes to permit multi-word --qemu-args and
--bootargs arguments.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 93a6c5a8517d..9b838c372698 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -277,8 +277,8 @@ awk < $T/cfgcpu.pack \
-v ncpus=$cpus \
-v rd=$resdir/$ds/ \
-v dur=$dur \
- -v TORTURE_QEMU_ARG=$TORTURE_QEMU_ARG \
- -v TORTURE_BOOTARGS=$TORTURE_BOOTARGS \
+ -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
+ -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \
'BEGIN {
i = 0;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (21 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 23/45] torture: Permit multi-word qemu and boot arguments Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 22:02 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 25/45] torture: Add tracing-enabled variant of TREE02 Paul E. McKenney
` (21 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Currently, the scripts hard-code arch/x86/boot/bzImage, which does not
work well for other architectures. This commit therefore provides a
identify_boot_image function that selects the correct bzImage location
relative to the top of the Linux source tree. This commit also adds a
--bootimage argument that allows selecting some other file, for example,
"vmlinux".
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/functions.sh | 21 +++++++++++++++++++++
.../selftests/rcutorture/bin/kvm-test-1-run.sh | 11 +++++------
tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 6b2adb29b073..efa95867e1cc 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -76,6 +76,27 @@ configfrag_hotplug_cpu () {
grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
}
+# identify_boot_image qemu-cmd
+#
+# Returns the relative path to the kernel build image. This will be
+# arch/<arch>/boot/bzImage unless overridden with the TORTURE_BOOT_IMAGE
+# environment variable.
+identify_boot_image () {
+ if test -n "$TORTURE_BOOT_IMAGE"
+ then
+ echo $TORTURE_BOOT_IMAGE
+ else
+ case "$1" in
+ qemu-system-x86_64|qemu-system-i386)
+ echo arch/x86/boot/bzImage
+ ;;
+ qemu-system-ppc64)
+ echo arch/powerpc/boot/bzImage
+ ;;
+ esac
+ fi
+}
+
# identify_qemu builddir
#
# Returns our best guess as to which qemu command is appropriate for
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 7848227aa4c1..7a95f86cc85a 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -94,9 +94,11 @@ fi
# CONFIG_YENTA=n
if kvm-build.sh $config_template $builddir $T
then
+ QEMU="`identify_qemu $builddir/vmlinux`"
+ BOOT_IMAGE="`identify_boot_image $QEMU`"
cp $builddir/Make*.out $resdir
cp $builddir/.config $resdir
- cp $builddir/arch/x86/boot/bzImage $resdir
+ cp $builddir/$BOOT_IMAGE $resdir
parse-build.sh $resdir/Make.out $title
if test -f $builddir.wait
then
@@ -124,9 +126,6 @@ cd $KVM
kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
echo ' ---' `date`: Starting kernel
-# Determine the appropriate flavor of qemu command.
-QEMU="`identify_qemu $builddir/vmlinux`"
-
# Generate -smp qemu argument.
qemu_args="-nographic $qemu_args"
cpu_count=`configNR_CPUS.sh $config_template`
@@ -151,13 +150,13 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
# Generate kernel-version-specific boot parameters
boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
-echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
+echo $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
if test -n "$TORTURE_BUILDONLY"
then
echo Build-only run specified, boot/test omitted.
exit 0
fi
-$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
+$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
qemu_pid=$!
commandcompleted=0
echo Monitoring qemu job at pid $qemu_pid
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 9b838c372698..4eed2a4f42c7 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -39,6 +39,7 @@ 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_SUITE=rcu
@@ -53,6 +54,7 @@ kversion=""
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\""
echo " --cpus N"
@@ -80,6 +82,11 @@ do
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
;;
@@ -245,6 +252,7 @@ CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
KVM="$KVM"; export KVM
KVPATH="$KVPATH"; export KVPATH
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
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 25/45] torture: Add tracing-enabled variant of TREE02
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (22 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 26/45] torture: Dump ftrace buffer when the RCU grace period stalls Paul E. McKenney
` (20 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit adds a CONFIG_RCU_TRACE=y version of TREE02 for debugging
purposes.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
.../selftests/rcutorture/configs/rcu/TREE02-T | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/TREE02-T
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T b/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T
new file mode 100644
index 000000000000..61c8d9ce5bb2
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T
@@ -0,0 +1,25 @@
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_PREEMPT_NONE=n
+CONFIG_PREEMPT_VOLUNTARY=n
+CONFIG_PREEMPT=y
+#CHECK#CONFIG_TREE_PREEMPT_RCU=y
+CONFIG_HZ_PERIODIC=n
+CONFIG_NO_HZ_IDLE=y
+CONFIG_NO_HZ_FULL=n
+CONFIG_RCU_FAST_NO_HZ=n
+CONFIG_RCU_TRACE=y
+CONFIG_HOTPLUG_CPU=n
+CONFIG_SUSPEND=n
+CONFIG_HIBERNATION=n
+CONFIG_RCU_FANOUT=3
+CONFIG_RCU_FANOUT_LEAF=3
+CONFIG_RCU_FANOUT_EXACT=n
+CONFIG_RCU_NOCB_CPU=n
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=n
+CONFIG_PROVE_RCU_DELAY=n
+CONFIG_RCU_CPU_STALL_INFO=n
+CONFIG_RCU_CPU_STALL_VERBOSE=y
+CONFIG_RCU_BOOST=n
+CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 26/45] torture: Dump ftrace buffer when the RCU grace period stalls
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (23 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 25/45] torture: Add tracing-enabled variant of TREE02 Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture Paul E. McKenney
` (19 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit adds a call to rcutorture_trace_dump() to dump the ftrace
buffer when the RCU grace period stalls in order to help debug the
stall. Note that this is different than the RCU CPU stall warning,
as it is rcutorture detecting the stall rather than the underlying RCU
implementation.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 0141fcff6bb9..50c26a7b6d97 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1033,6 +1033,7 @@ rcu_torture_printk(char *page)
"??? Writer stall state %d g%lu c%lu f%#x\n",
rcu_torture_writer_state,
gpnum, completed, flags);
+ rcutorture_trace_dump();
}
rtcv_snap = rcu_torture_current_version;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (24 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 26/45] torture: Dump ftrace buffer when the RCU grace period stalls Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 22:05 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 28/45] percpu: Fix raw_cpu_inc_return() Paul E. McKenney
` (18 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit allows rcutorture to print additional state for the
RCU grace-period kthreads in cases where RCU seems reluctant to
start a new grace period.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/rcutiny.h | 4 ++++
include/linux/rcutree.h | 1 +
kernel/rcu/rcutorture.c | 1 +
kernel/rcu/tree.c | 17 +++++++++++++++++
kernel/rcu/tree.h | 8 +++++++-
5 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 425c659d54e5..d40a6a451330 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -119,6 +119,10 @@ static inline void rcu_sched_force_quiescent_state(void)
{
}
+static inline void show_rcu_gp_kthreads(void)
+{
+}
+
static inline void rcu_cpu_stall_reset(void)
{
}
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index a59ca05fd4e3..3e2f5d432743 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -84,6 +84,7 @@ extern unsigned long rcutorture_vernum;
long rcu_batches_completed(void);
long rcu_batches_completed_bh(void);
long rcu_batches_completed_sched(void);
+void show_rcu_gp_kthreads(void);
void rcu_force_quiescent_state(void);
void rcu_bh_force_quiescent_state(void);
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 50c26a7b6d97..15af04177e7e 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1033,6 +1033,7 @@ rcu_torture_printk(char *page)
"??? Writer stall state %d g%lu c%lu f%#x\n",
rcu_torture_writer_state,
gpnum, completed, flags);
+ show_rcu_gp_kthreads();
rcutorture_trace_dump();
}
rtcv_snap = rcu_torture_current_version;
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 032106df7391..3107bd935b2b 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -280,6 +280,21 @@ void rcu_bh_force_quiescent_state(void)
EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state);
/*
+ * Show the state of the grace-period kthreads.
+ */
+void show_rcu_gp_kthreads(void)
+{
+ struct rcu_state *rsp;
+
+ for_each_rcu_flavor(rsp) {
+ pr_info("%s: wait state: %d ->state: %#lx\n",
+ rsp->name, rsp->gp_state, rsp->gp_kthread->state);
+ /* sched_show_task(rsp->gp_kthread); */
+ }
+}
+EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads);
+
+/*
* Record the number of times rcutorture tests have been initiated and
* terminated. This information allows the debugfs tracing stats to be
* correlated to the rcutorture messages, even when the rcutorture module
@@ -1611,6 +1626,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
trace_rcu_grace_period(rsp->name,
ACCESS_ONCE(rsp->gpnum),
TPS("reqwait"));
+ rsp->gp_state = RCU_GP_WAIT_GPS;
wait_event_interruptible(rsp->gp_wq,
ACCESS_ONCE(rsp->gp_flags) &
RCU_GP_FLAG_INIT);
@@ -1638,6 +1654,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
trace_rcu_grace_period(rsp->name,
ACCESS_ONCE(rsp->gpnum),
TPS("fqswait"));
+ rsp->gp_state = RCU_GP_WAIT_FQS;
ret = wait_event_interruptible_timeout(rsp->gp_wq,
((gf = ACCESS_ONCE(rsp->gp_flags)) &
RCU_GP_FLAG_FQS) ||
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 75dc3c39a02a..c2fd1e722879 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -406,7 +406,8 @@ struct rcu_state {
unsigned long completed; /* # of last completed gp. */
struct task_struct *gp_kthread; /* Task for grace periods. */
wait_queue_head_t gp_wq; /* Where GP task waits. */
- int gp_flags; /* Commands for GP task. */
+ short gp_flags; /* Commands for GP task. */
+ short gp_state; /* GP kthread sleep state. */
/* End of fields guarded by root rcu_node's lock. */
@@ -469,6 +470,11 @@ struct rcu_state {
#define RCU_GP_FLAG_INIT 0x1 /* Need grace-period initialization. */
#define RCU_GP_FLAG_FQS 0x2 /* Need grace-period quiescent-state forcing. */
+/* Values for rcu_state structure's gp_flags field. */
+#define RCU_GP_WAIT_INIT 0 /* Initial state. */
+#define RCU_GP_WAIT_GPS 1 /* Wait for grace-period start. */
+#define RCU_GP_WAIT_FQS 2 /* Wait for force-quiescent-state time. */
+
extern struct list_head rcu_struct_flavors;
/* Sequence through rcu_state structures for each RCU flavor. */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 28/45] percpu: Fix raw_cpu_inc_return()
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (25 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 29/45] sched,rcu: Make cond_resched() report RCU quiescent states Paul E. McKenney
` (17 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The definition for raw_cpu_add_return() uses the operation prefix
"raw_add_return_", but the definitions in the various percpu.h files
expect "raw_cpu_add_return_". This commit therefore appropriately
adjusts the definition of raw_cpu_add_return().
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Christoph Lameter <cl@linux.com>
---
include/linux/percpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index e7a0b95ed527..495c6543a8f2 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -639,7 +639,7 @@ do { \
# define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val)
# endif
# define raw_cpu_add_return(pcp, val) \
- __pcpu_size_call_return2(raw_add_return_, pcp, val)
+ __pcpu_size_call_return2(raw_cpu_add_return_, pcp, val)
#endif
#define raw_cpu_sub_return(pcp, val) raw_cpu_add_return(pcp, -(typeof(pcp))(val))
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 29/45] sched,rcu: Make cond_resched() report RCU quiescent states
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (26 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 28/45] percpu: Fix raw_cpu_inc_return() Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 30/45] rcutorture: Make rcu_torture_reader() use cond_resched() Paul E. McKenney
` (16 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Given a CPU running a loop containing cond_resched(), with no
other tasks runnable on that CPU, RCU will eventually report RCU
CPU stall warnings due to lack of quiescent states. Fortunately,
every call to cond_resched() is a perfectly good quiescent state.
Unfortunately, invoking rcu_note_context_switch() is a bit heavyweight
for cond_resched(), especially given the need to disable preemption,
and, for RCU-preempt, interrupts as well.
This commit therefore maintains a per-CPU counter that causes
cond_resched(), cond_resched_lock(), and cond_resched_softirq() to call
rcu_note_context_switch(), but only about once per 256 invocations.
This ratio was chosen in keeping with the relative time constants of
RCU grace periods.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/rcupdate.h | 36 ++++++++++++++++++++++++++++++++++++
kernel/rcu/update.c | 18 ++++++++++++++++++
kernel/sched/core.c | 7 ++++++-
3 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a6c3898e141e..baead1bd0556 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -44,6 +44,7 @@
#include <linux/debugobjects.h>
#include <linux/bug.h>
#include <linux/compiler.h>
+#include <linux/percpu.h>
#include <asm/barrier.h>
extern int rcu_expedited; /* for sysctl */
@@ -287,6 +288,41 @@ bool __rcu_is_watching(void);
#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */
/*
+ * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings.
+ */
+
+#define RCU_COND_RESCHED_LIM 256 /* ms vs. 100s of ms. */
+DECLARE_PER_CPU(int, rcu_cond_resched_count);
+void rcu_resched(void);
+
+/*
+ * Is it time to report RCU quiescent states?
+ *
+ * Note unsynchronized access to rcu_cond_resched_count. Yes, we might
+ * increment some random CPU's count, and possibly also load the result from
+ * yet another CPU's count. We might even clobber some other CPU's attempt
+ * to zero its counter. This is all OK because the goal is not precision,
+ * but rather reasonable amortization of rcu_note_context_switch() overhead
+ * and extremely high probability of avoiding RCU CPU stall warnings.
+ * Note that this function has to be preempted in just the wrong place,
+ * many thousands of times in a row, for anything bad to happen.
+ */
+static inline bool rcu_should_resched(void)
+{
+ return raw_cpu_inc_return(rcu_cond_resched_count) >=
+ RCU_COND_RESCHED_LIM;
+}
+
+/*
+ * Report quiscent states to RCU if it is time to do so.
+ */
+static inline void rcu_cond_resched(void)
+{
+ if (unlikely(rcu_should_resched()))
+ rcu_resched();
+}
+
+/*
* Infrastructure to implement the synchronize_() primitives in
* TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
*/
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 4c0a9b0af469..ed7a0d72562c 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -338,3 +338,21 @@ static int __init check_cpu_stall_init(void)
early_initcall(check_cpu_stall_init);
#endif /* #ifdef CONFIG_RCU_STALL_COMMON */
+
+/*
+ * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings.
+ */
+
+DEFINE_PER_CPU(int, rcu_cond_resched_count);
+
+/*
+ * Report a set of RCU quiescent states, for use by cond_resched()
+ * and friends. Out of line due to being called infrequently.
+ */
+void rcu_resched(void)
+{
+ preempt_disable();
+ __this_cpu_write(rcu_cond_resched_count, 0);
+ rcu_note_context_switch(smp_processor_id());
+ preempt_enable();
+}
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 268a45ea238c..9f530c9ed911 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4051,6 +4051,7 @@ static void __cond_resched(void)
int __sched _cond_resched(void)
{
+ rcu_cond_resched();
if (should_resched()) {
__cond_resched();
return 1;
@@ -4069,15 +4070,18 @@ EXPORT_SYMBOL(_cond_resched);
*/
int __cond_resched_lock(spinlock_t *lock)
{
+ bool need_rcu_resched = rcu_should_resched();
int resched = should_resched();
int ret = 0;
lockdep_assert_held(lock);
- if (spin_needbreak(lock) || resched) {
+ if (spin_needbreak(lock) || resched || need_rcu_resched) {
spin_unlock(lock);
if (resched)
__cond_resched();
+ else if (unlikely(need_rcu_resched))
+ rcu_resched();
else
cpu_relax();
ret = 1;
@@ -4091,6 +4095,7 @@ int __sched __cond_resched_softirq(void)
{
BUG_ON(!in_softirq());
+ rcu_cond_resched(); /* BH disabled OK, just recording QSes. */
if (should_resched()) {
local_bh_enable();
__cond_resched();
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 30/45] rcutorture: Make rcu_torture_reader() use cond_resched()
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (27 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 29/45] sched,rcu: Make cond_resched() report RCU quiescent states Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 31/45] torture: Notice if an all-zero cpumask is passed inside a critical section Paul E. McKenney
` (15 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The rcu_torture_reader() function currently uses schedule(). This commit
therefore speeds things up a bit by substituting cond_resched().
This change makes rcu_torture_reader() more CPU-bound, so this commit
also adjusts the number of readers (the "nreaders" module parameter,
which feeds into the "nrealreaders" variable) to allow one CPU to be
free of readers on SMP systems. The point of this is to increase the
probability that readers will be watching while an updater makes a change.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 15af04177e7e..ea8af005ea3f 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -941,7 +941,7 @@ rcu_torture_reader(void *arg)
__this_cpu_inc(rcu_torture_batch[completed]);
preempt_enable();
cur_ops->readunlock(idx);
- schedule();
+ cond_resched();
stutter_wait("rcu_torture_reader");
} while (!torture_must_stop());
if (irqreader && cur_ops->irq_capable)
@@ -1481,10 +1481,13 @@ rcu_torture_init(void)
if (cur_ops->init)
cur_ops->init(); /* no "goto unwind" prior to this point!!! */
- if (nreaders >= 0)
+ if (nreaders >= 0) {
nrealreaders = nreaders;
- else
- nrealreaders = 2 * num_online_cpus();
+ } else {
+ nrealreaders = num_online_cpus() - 1;
+ if (nrealreaders <= 0)
+ nrealreaders = 1;
+ }
rcu_torture_print_module_parms(cur_ops, "Start of test");
/* Set up the freelist. */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 31/45] torture: Notice if an all-zero cpumask is passed inside a critical section
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (28 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 30/45] rcutorture: Make rcu_torture_reader() use cond_resched() Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures Paul E. McKenney
` (14 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Iulia Manda, Paul E. McKenney
From: Iulia Manda <iulia.manda21@gmail.com>
In torture_shuffle_tasks function, the check if an all-zero mask can
be passed to set_cpus_allowed_ptr() is redundant after clearing the
shuffle_idle_cpu bit. If the mask had more than one bit set, after
clearing a bit it has at least one bit set. If the mask had only
one bit set, a check is made at the beginning, where the function
returns, as there is no need to shuffle only one cpu.
Also, this code is executed inside a critical section, delimited by
get_online_cpus(), and put_online_cpus(), preventing CPUs from leaving between
the check of num_online_cpus and the calls to set_cpus_allowed_ptr() function.
Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/torture.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/kernel/torture.c b/kernel/torture.c
index bd768effba9a..c1d57e83e8fe 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -335,13 +335,8 @@ static void torture_shuffle_tasks(void)
shuffle_idle_cpu = cpumask_next(shuffle_idle_cpu, shuffle_tmp_mask);
if (shuffle_idle_cpu >= nr_cpu_ids)
shuffle_idle_cpu = -1;
- if (shuffle_idle_cpu != -1) {
+ else
cpumask_clear_cpu(shuffle_idle_cpu, shuffle_tmp_mask);
- if (cpumask_empty(shuffle_tmp_mask)) {
- put_online_cpus();
- return;
- }
- }
mutex_lock(&shuffle_task_mutex);
list_for_each_entry(stp, &shuffle_task_list, st_l)
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (29 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 31/45] torture: Notice if an all-zero cpumask is passed inside a critical section Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 22:11 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 33/45] rcutorture: Check for rcu_torture_fqs creation errors Paul E. McKenney
` (13 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The reaction of kvm-recheck.sh is obscure at best, and easy to miss
completely. This commit therefore prints "BUG: Build failed" in the
summary at the end of a run.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
.../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
.../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +-
.../selftests/rcutorture/bin/kvm-recheck.sh | 24 ++++++++++++++++------
.../selftests/rcutorture/bin/kvm-test-1-run.sh | 1 +
4 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
index 829186e19eb1..7f1ff1a8fc4b 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
@@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
if test -z "$ncs"
then
- echo $configfile
+ echo "$configfile -------"
else
title="$configfile ------- $ncs acquisitions/releases"
dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index d75b1dc5ae53..307c4b95f325 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
if test -z "$ngps"
then
- echo $configfile
+ echo "$configfile -------"
else
title="$configfile ------- $ngps grace periods"
dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index 26d78b7eaccf..ee1f6cae3d70 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -25,6 +25,7 @@
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
+. tools/testing/selftests/rcutorture/bin/functions.sh
for rd in "$@"
do
firsttime=1
@@ -39,13 +40,24 @@ do
fi
TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
kvm-recheck-${TORTURE_SUITE}.sh $i
- configcheck.sh $i/.config $i/ConfigFragment
- parse-build.sh $i/Make.out $configfile
- parse-torture.sh $i/console.log $configfile
- parse-console.sh $i/console.log $configfile
- if test -r $i/Warnings
+ if test -f "$i/console.log"
then
- cat $i/Warnings
+ configcheck.sh $i/.config $i/ConfigFragment
+ parse-build.sh $i/Make.out $configfile
+ parse-torture.sh $i/console.log $configfile
+ parse-console.sh $i/console.log $configfile
+ if test -r $i/Warnings
+ then
+ cat $i/Warnings
+ fi
+ else
+ if test -f "$i/qemu-cmd"
+ then
+ print_bug qemu failed
+ else
+ print_bug Build failed
+ fi
+ echo " $i"
fi
done
done
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 7a95f86cc85a..51c34a91a375 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -106,6 +106,7 @@ then
fi
else
cp $builddir/Make*.out $resdir
+ cp $builddir/.config $resdir || :
echo Build failed, not running KVM, see $resdir.
if test -f $builddir.wait
then
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 33/45] rcutorture: Check for rcu_torture_fqs creation errors
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (30 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 34/45] torture: Use elapsed time to detect hangs Paul E. McKenney
` (12 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The return value from torture_create_kthread() is currently ignored
when creating the rcu_torture_fqs kthread. This commit therefore
captures the return value so that it can be tested for errors.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index ea8af005ea3f..cf231f508139 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1576,7 +1576,8 @@ rcu_torture_init(void)
fqs_duration = 0;
if (fqs_duration) {
/* Create the fqs thread */
- torture_create_kthread(rcu_torture_fqs, NULL, fqs_task);
+ firsterr = torture_create_kthread(rcu_torture_fqs, NULL,
+ fqs_task);
if (firsterr)
goto unwind;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 34/45] torture: Use elapsed time to detect hangs
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (31 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 33/45] rcutorture: Check for rcu_torture_fqs creation errors Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 35/45] rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels Paul E. McKenney
` (11 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The kvm-test-1-run.sh currently counts "sleep 1" commands to detect
hangs. This can fail spectacularly on busy systems, where "sleep 1"
might take far longer than one second to complete. This commit
therefore changes hang detection to use elapsed time measurements.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
.../testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
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 51c34a91a375..b1e85b049075 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -161,14 +161,18 @@ $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boo
qemu_pid=$!
commandcompleted=0
echo Monitoring qemu job at pid $qemu_pid
-for ((i=0;i<$seconds;i++))
+while :
do
+ kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
if kill -0 $qemu_pid > /dev/null 2>&1
then
+ if test $kruntime -ge $seconds
+ then
+ break;
+ fi
sleep 1
else
commandcompleted=1
- kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
if test $kruntime -lt $seconds
then
echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
@@ -189,20 +193,22 @@ done
if test $commandcompleted -eq 0
then
echo Grace period for qemu job at pid $qemu_pid
- for ((i=0;i<=$grace;i++))
+ while :
do
+ kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
if kill -0 $qemu_pid > /dev/null 2>&1
then
- sleep 1
+ :
else
break
fi
- if test $i -eq $grace
+ if test $kruntime -ge $((seconds + grace))
then
- kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }'`
echo "!!! Hang at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1
kill -KILL $qemu_pid
+ break
fi
+ sleep 1
done
fi
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 35/45] rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (32 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 34/45] torture: Use elapsed time to detect hangs Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 36/45] rcutorture: Add tests for get_state_synchronize_rcu() Paul E. McKenney
` (10 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit ensures that RCU-sched primitives are tested in
TREE_PREEMPT_RCU kernels, a combination that was previously omitted.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot | 1 +
1 file changed, 1 insertion(+)
create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
new file mode 100644
index 000000000000..3b42b8b033cd
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
@@ -0,0 +1 @@
+rcutorture.torture_type=sched
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 36/45] rcutorture: Add tests for get_state_synchronize_rcu()
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (33 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 35/45] rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 37/45] rcutorture: Explicitly test synchronous grace-period primitives Paul E. McKenney
` (9 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit adds rcutorture testing for get_state_synchronize_rcu()
and cond_synchronize_rcu().
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 130 +++++++++++++++++++++++++++++++++++-------------
1 file changed, 95 insertions(+), 35 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index cf231f508139..9f344ec32e69 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -58,6 +58,7 @@ torture_param(int, fqs_duration, 0,
"Duration of fqs bursts (us), 0 to disable");
torture_param(int, fqs_holdoff, 0, "Holdoff time within fqs bursts (us)");
torture_param(int, fqs_stutter, 3, "Wait time between fqs bursts (s)");
+torture_param(bool, gp_cond, false, "Use conditional/async GP wait primitives");
torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
torture_param(bool, gp_normal, false,
"Use normal (non-expedited) GP wait primitives");
@@ -144,8 +145,10 @@ static int rcu_torture_writer_state;
#define RTWS_REPLACE 2
#define RTWS_DEF_FREE 3
#define RTWS_EXP_SYNC 4
-#define RTWS_STUTTER 5
-#define RTWS_STOPPING 6
+#define RTWS_COND_GET 5
+#define RTWS_COND_SYNC 6
+#define RTWS_STUTTER 7
+#define RTWS_STOPPING 8
#if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
#define RCUTORTURE_RUNNABLE_INIT 1
@@ -232,6 +235,8 @@ struct rcu_torture_ops {
void (*deferred_free)(struct rcu_torture *p);
void (*sync)(void);
void (*exp_sync)(void);
+ unsigned long (*get_state)(void);
+ void (*cond_sync)(unsigned long oldstate);
void (*call)(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
void (*cb_barrier)(void);
void (*fqs)(void);
@@ -283,10 +288,48 @@ static int rcu_torture_completed(void)
return rcu_batches_completed();
}
+/*
+ * Update callback in the pipe. This should be invoked after a grace period.
+ */
+static bool
+rcu_torture_pipe_update_one(struct rcu_torture *rp)
+{
+ int i;
+
+ i = rp->rtort_pipe_count;
+ if (i > RCU_TORTURE_PIPE_LEN)
+ i = RCU_TORTURE_PIPE_LEN;
+ atomic_inc(&rcu_torture_wcount[i]);
+ if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
+ rp->rtort_mbtest = 0;
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Update all callbacks in the pipe. Suitable for synchronous grace-period
+ * primitives.
+ */
+static void
+rcu_torture_pipe_update(struct rcu_torture *old_rp)
+{
+ struct rcu_torture *rp;
+ struct rcu_torture *rp1;
+
+ if (old_rp)
+ list_add(&old_rp->rtort_free, &rcu_torture_removed);
+ list_for_each_entry_safe(rp, rp1, &rcu_torture_removed, rtort_free) {
+ if (rcu_torture_pipe_update_one(rp)) {
+ list_del(&rp->rtort_free);
+ rcu_torture_free(rp);
+ }
+ }
+}
+
static void
rcu_torture_cb(struct rcu_head *p)
{
- int i;
struct rcu_torture *rp = container_of(p, struct rcu_torture, rtort_rcu);
if (torture_must_stop_irq()) {
@@ -294,16 +337,10 @@ rcu_torture_cb(struct rcu_head *p)
/* The next initialization will pick up the pieces. */
return;
}
- i = rp->rtort_pipe_count;
- if (i > RCU_TORTURE_PIPE_LEN)
- i = RCU_TORTURE_PIPE_LEN;
- atomic_inc(&rcu_torture_wcount[i]);
- if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
- rp->rtort_mbtest = 0;
+ if (rcu_torture_pipe_update_one(rp))
rcu_torture_free(rp);
- } else {
+ else
cur_ops->deferred_free(rp);
- }
}
static int rcu_no_completed(void)
@@ -331,6 +368,8 @@ static struct rcu_torture_ops rcu_ops = {
.deferred_free = rcu_torture_deferred_free,
.sync = synchronize_rcu,
.exp_sync = synchronize_rcu_expedited,
+ .get_state = get_state_synchronize_rcu,
+ .cond_sync = cond_synchronize_rcu,
.call = call_rcu,
.cb_barrier = rcu_barrier,
.fqs = rcu_force_quiescent_state,
@@ -704,16 +743,39 @@ rcu_torture_fqs(void *arg)
static int
rcu_torture_writer(void *arg)
{
- bool exp;
+ unsigned long gp_snap;
+ bool gp_cond1 = gp_cond, gp_exp1 = gp_exp, gp_normal1 = gp_normal;
int i;
struct rcu_torture *rp;
- struct rcu_torture *rp1;
struct rcu_torture *old_rp;
static DEFINE_TORTURE_RANDOM(rand);
+ int synctype[] = { RTWS_DEF_FREE, RTWS_EXP_SYNC, RTWS_COND_GET };
+ int nsynctypes = 0;
VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
set_user_nice(current, MAX_NICE);
+ /* Initialize synctype[] array. If none set, take default. */
+ if (!gp_cond1 && !gp_exp1 && !gp_normal1)
+ gp_cond1 = gp_exp1 = gp_normal1 = true;
+ if (gp_cond1 && cur_ops->get_state && cur_ops->cond_sync)
+ synctype[nsynctypes++] = RTWS_COND_GET;
+ else if (gp_cond && (!cur_ops->get_state || !cur_ops->cond_sync))
+ pr_alert("rcu_torture_writer: gp_cond without primitives.\n");
+ if (gp_exp1 && cur_ops->exp_sync)
+ synctype[nsynctypes++] = RTWS_EXP_SYNC;
+ else if (gp_exp && !cur_ops->exp_sync)
+ pr_alert("rcu_torture_writer: gp_exp without primitives.\n");
+ if (gp_normal1 && cur_ops->deferred_free)
+ synctype[nsynctypes++] = RTWS_DEF_FREE;
+ else if (gp_normal && !cur_ops->deferred_free)
+ pr_alert("rcu_torture_writer: gp_normal without primitives.\n");
+ if (WARN_ONCE(nsynctypes == 0,
+ "rcu_torture_writer: No update-side primitives.\n")) {
+ rcu_torture_writer_state = RTWS_STOPPING;
+ torture_kthread_stopping("rcu_torture_writer");
+ }
+
do {
rcu_torture_writer_state = RTWS_FIXED_DELAY;
schedule_timeout_uninterruptible(1);
@@ -735,32 +797,30 @@ rcu_torture_writer(void *arg)
i = RCU_TORTURE_PIPE_LEN;
atomic_inc(&rcu_torture_wcount[i]);
old_rp->rtort_pipe_count++;
- if (gp_normal == gp_exp)
- exp = !!(torture_random(&rand) & 0x80);
- else
- exp = gp_exp;
- if (!exp) {
+ switch (synctype[torture_random(&rand) % nsynctypes]) {
+ case RTWS_DEF_FREE:
rcu_torture_writer_state = RTWS_DEF_FREE;
cur_ops->deferred_free(old_rp);
- } else {
+ break;
+ case RTWS_EXP_SYNC:
rcu_torture_writer_state = RTWS_EXP_SYNC;
cur_ops->exp_sync();
- list_add(&old_rp->rtort_free,
- &rcu_torture_removed);
- list_for_each_entry_safe(rp, rp1,
- &rcu_torture_removed,
- rtort_free) {
- i = rp->rtort_pipe_count;
- if (i > RCU_TORTURE_PIPE_LEN)
- i = RCU_TORTURE_PIPE_LEN;
- atomic_inc(&rcu_torture_wcount[i]);
- if (++rp->rtort_pipe_count >=
- RCU_TORTURE_PIPE_LEN) {
- rp->rtort_mbtest = 0;
- list_del(&rp->rtort_free);
- rcu_torture_free(rp);
- }
- }
+ rcu_torture_pipe_update(old_rp);
+ break;
+ case RTWS_COND_GET:
+ rcu_torture_writer_state = RTWS_COND_GET;
+ gp_snap = cur_ops->get_state();
+ i = torture_random(&rand) % 16;
+ if (i != 0)
+ schedule_timeout_interruptible(i);
+ udelay(torture_random(&rand) % 1000);
+ rcu_torture_writer_state = RTWS_COND_SYNC;
+ cur_ops->cond_sync(gp_snap);
+ rcu_torture_pipe_update(old_rp);
+ break;
+ default:
+ WARN_ON_ONCE(1);
+ break;
}
}
rcutorture_record_progress(++rcu_torture_current_version);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 37/45] rcutorture: Explicitly test synchronous grace-period primitives
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (34 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 36/45] rcutorture: Add tests for get_state_synchronize_rcu() Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 38/45] rcutorture: Add missing destroy_timer_on_stack() Paul E. McKenney
` (8 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The original rcu_torture_writer() avoided testing the synchronous
grace-period primitives because they were simply wrappers around
call_rcu() invocations. The testing of these synchronous primitives
was delegated to the fake writers. However, there really is no excuse
not to test them, especially in the case of SRCU, where the wrappering
is somewhat more elaborate. This commit therefore makes the default
rcutorture parameters cause rcu_torture_writer() to include synchronous
grace-period primitives in its testing.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 9f344ec32e69..576d12263c81 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -62,6 +62,7 @@ torture_param(bool, gp_cond, false, "Use conditional/async GP wait primitives");
torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
torture_param(bool, gp_normal, false,
"Use normal (non-expedited) GP wait primitives");
+torture_param(bool, gp_sync, false, "Use synchronous GP wait primitives");
torture_param(int, irqreader, 1, "Allow RCU readers from irq handlers");
torture_param(int, n_barrier_cbs, 0,
"# of callbacks/kthreads for barrier testing");
@@ -147,8 +148,9 @@ static int rcu_torture_writer_state;
#define RTWS_EXP_SYNC 4
#define RTWS_COND_GET 5
#define RTWS_COND_SYNC 6
-#define RTWS_STUTTER 7
-#define RTWS_STOPPING 8
+#define RTWS_SYNC 7
+#define RTWS_STUTTER 8
+#define RTWS_STOPPING 9
#if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
#define RCUTORTURE_RUNNABLE_INIT 1
@@ -745,19 +747,21 @@ rcu_torture_writer(void *arg)
{
unsigned long gp_snap;
bool gp_cond1 = gp_cond, gp_exp1 = gp_exp, gp_normal1 = gp_normal;
+ bool gp_sync1 = gp_sync;
int i;
struct rcu_torture *rp;
struct rcu_torture *old_rp;
static DEFINE_TORTURE_RANDOM(rand);
- int synctype[] = { RTWS_DEF_FREE, RTWS_EXP_SYNC, RTWS_COND_GET };
+ int synctype[] = { RTWS_DEF_FREE, RTWS_EXP_SYNC,
+ RTWS_COND_GET, RTWS_SYNC };
int nsynctypes = 0;
VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
set_user_nice(current, MAX_NICE);
/* Initialize synctype[] array. If none set, take default. */
- if (!gp_cond1 && !gp_exp1 && !gp_normal1)
- gp_cond1 = gp_exp1 = gp_normal1 = true;
+ if (!gp_cond1 && !gp_exp1 && !gp_normal1 && !gp_sync)
+ gp_cond1 = gp_exp1 = gp_normal1 = gp_sync1 = true;
if (gp_cond1 && cur_ops->get_state && cur_ops->cond_sync)
synctype[nsynctypes++] = RTWS_COND_GET;
else if (gp_cond && (!cur_ops->get_state || !cur_ops->cond_sync))
@@ -770,8 +774,17 @@ rcu_torture_writer(void *arg)
synctype[nsynctypes++] = RTWS_DEF_FREE;
else if (gp_normal && !cur_ops->deferred_free)
pr_alert("rcu_torture_writer: gp_normal without primitives.\n");
+ if (gp_sync1 && cur_ops->sync)
+ synctype[nsynctypes++] = RTWS_SYNC;
+ else if (gp_sync && !cur_ops->sync)
+ pr_alert("rcu_torture_writer: gp_sync without primitives.\n");
if (WARN_ONCE(nsynctypes == 0,
"rcu_torture_writer: No update-side primitives.\n")) {
+ /*
+ * No updates primitives, so don't try updating.
+ * The resulting test won't be testing much, hence the
+ * above WARN_ONCE().
+ */
rcu_torture_writer_state = RTWS_STOPPING;
torture_kthread_stopping("rcu_torture_writer");
}
@@ -818,6 +831,11 @@ rcu_torture_writer(void *arg)
cur_ops->cond_sync(gp_snap);
rcu_torture_pipe_update(old_rp);
break;
+ case RTWS_SYNC:
+ rcu_torture_writer_state = RTWS_SYNC;
+ cur_ops->sync();
+ rcu_torture_pipe_update(old_rp);
+ break;
default:
WARN_ON_ONCE(1);
break;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 38/45] rcutorture: Add missing destroy_timer_on_stack()
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (35 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 37/45] rcutorture: Explicitly test synchronous grace-period primitives Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits Paul E. McKenney
` (7 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: Thomas Gleixner <tglx@linutronix.de>
The rcu_torture_reader() function uses an on-stack timer_list structure
which it initializes with setup_timer_on_stack(). However, it fails to
use destroy_timer_on_stack() before exiting, which results in leaking a
tracking object if DEBUG_OBJECTS is enabled. This commit therefore
invokes destroy_timer_on_stack() to avoid this leakage.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 576d12263c81..a576583dd81e 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1022,8 +1022,10 @@ rcu_torture_reader(void *arg)
cond_resched();
stutter_wait("rcu_torture_reader");
} while (!torture_must_stop());
- if (irqreader && cur_ops->irq_capable)
+ if (irqreader && cur_ops->irq_capable) {
del_timer_sync(&t);
+ destroy_timer_on_stack(&t);
+ }
torture_kthread_stopping("rcu_torture_reader");
return 0;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (36 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 38/45] rcutorture: Add missing destroy_timer_on_stack() Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 22:17 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 40/45] rcutorture: Run rcu_torture_writer at normal priority Paul E. McKenney
` (6 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The current scripting only keeps track of the git SHA-1 of the current
HEAD. This can cause confusion in cases where testing ran in a git
tree where changes had not yet been checked in. This commit therefore
also records the output of "git diff HEAD" to provide the information
needed to reconstruct the source tree that was tested.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 4eed2a4f42c7..91661845fdec 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -277,6 +277,11 @@ if test -d .git
then
git status >> $resdir/$ds/testid.txt
git rev-parse HEAD >> $resdir/$ds/testid.txt
+ git diff HEAD > $T/git-diff 2>&1
+ if test -s $T/git-diff
+ then
+ cp $T/git-diff $resdir/$ds
+ fi
fi
___EOF___
awk < $T/cfgcpu.pack \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 40/45] rcutorture: Run rcu_torture_writer at normal priority
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (37 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 41/45] torture: Put qemu into the background Paul E. McKenney
` (5 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
There are usually lots of readers and only one writer, so if there has
to be a choice, we would want rcu_torture_writer to win. This commit
therefore removes the set_user_nice() from rcu_torture_writer().
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/rcutorture.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index a576583dd81e..b181b11c398e 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -757,7 +757,6 @@ rcu_torture_writer(void *arg)
int nsynctypes = 0;
VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
- set_user_nice(current, MAX_NICE);
/* Initialize synctype[] array. If none set, take default. */
if (!gp_cond1 && !gp_exp1 && !gp_normal1 && !gp_sync)
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 41/45] torture: Put qemu into the background
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (38 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 40/45] rcutorture: Run rcu_torture_writer at normal priority Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 22:18 ` josh
2014-04-29 0:25 ` [PATCH tip/core/rcu 42/45] locktorture: Remove reference to nonexistent Kconfig parameter Paul E. McKenney
` (4 subsequent siblings)
44 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Currently, qemu runs in the foreground, which prevents the script from
killing it in case the kernel locks up. This commit therefore places
qemu into the background, allowing the script to recover from lockups.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 b1e85b049075..67e89f06e77f 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -157,7 +157,7 @@ then
echo Build-only run specified, boot/test omitted.
exit 0
fi
-$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
+( $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) &
qemu_pid=$!
commandcompleted=0
echo Monitoring qemu job at pid $qemu_pid
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 42/45] locktorture: Remove reference to nonexistent Kconfig parameter
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (39 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 41/45] torture: Put qemu into the background Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 43/45] torture: Check for multiple concurrent torture tests Paul E. McKenney
` (3 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The locktorture module references CONFIG_LOCK_TORTURE_TEST_RUNNABLE,
which does not exist. Which is a good thing, because otherwise
randconfig testing could enable both rcutorture and locktorture
concurrently, which the torture tests are not set up for. This
commit therefore removes the reference, so that test is runnable
immediately only when inserted as a module.
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/locking/locktorture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index b0d3e3c50672..1952466c7db5 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -82,14 +82,14 @@ struct lock_writer_stress_stats {
};
static struct lock_writer_stress_stats *lwsa;
-#if defined(MODULE) || defined(CONFIG_LOCK_TORTURE_TEST_RUNNABLE)
+#if defined(MODULE)
#define LOCKTORTURE_RUNNABLE_INIT 1
#else
#define LOCKTORTURE_RUNNABLE_INIT 0
#endif
int locktorture_runnable = LOCKTORTURE_RUNNABLE_INIT;
module_param(locktorture_runnable, int, 0444);
-MODULE_PARM_DESC(locktorture_runnable, "Start locktorture at boot");
+MODULE_PARM_DESC(locktorture_runnable, "Start locktorture at module init");
/* Forward reference. */
static void lock_torture_cleanup(void);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 43/45] torture: Check for multiple concurrent torture tests
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (40 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 42/45] locktorture: Remove reference to nonexistent Kconfig parameter Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 44/45] torture: Remove __init from torture_init_begin/end Paul E. McKenney
` (2 subsequent siblings)
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
The torture tests are designed to run in isolation, but do not enforce
this isolation. This commit therefore checks for concurrent torture
tests, and refuses to start new tests while old tests are running.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/torture.h | 2 +-
kernel/locking/locktorture.c | 3 ++-
kernel/rcu/rcutorture.c | 3 ++-
kernel/torture.c | 13 +++++++++++--
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h
index b2e2b468e511..f998574247fd 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -81,7 +81,7 @@ void stutter_wait(const char *title);
int torture_stutter_init(int s);
/* Initialization and cleanup. */
-void torture_init_begin(char *ttype, bool v, int *runnable);
+bool torture_init_begin(char *ttype, bool v, int *runnable);
void torture_init_end(void);
bool torture_cleanup(void);
bool torture_must_stop(void);
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 1952466c7db5..dbafeac18e4d 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -355,7 +355,8 @@ static int __init lock_torture_init(void)
&lock_busted_ops, &spin_lock_ops, &spin_lock_irq_ops,
};
- torture_init_begin(torture_type, verbose, &locktorture_runnable);
+ if (!torture_init_begin(torture_type, verbose, &locktorture_runnable))
+ return -EBUSY;
/* Process args and tell the world that the torturer is on the job. */
for (i = 0; i < ARRAY_SIZE(torture_ops); i++) {
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index b181b11c398e..1d8559198bd5 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1535,7 +1535,8 @@ rcu_torture_init(void)
&rcu_ops, &rcu_bh_ops, &rcu_busted_ops, &srcu_ops, &sched_ops,
};
- torture_init_begin(torture_type, verbose, &rcutorture_runnable);
+ if (!torture_init_begin(torture_type, verbose, &rcutorture_runnable))
+ return -EBUSY;
/* Process args and tell the world that the torturer is on the job. */
for (i = 0; i < ARRAY_SIZE(torture_ops); i++) {
diff --git a/kernel/torture.c b/kernel/torture.c
index c1d57e83e8fe..de440a46331c 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -599,14 +599,20 @@ static void torture_stutter_cleanup(void)
* The runnable parameter points to a flag that controls whether or not
* the test is currently runnable. If there is no such flag, pass in NULL.
*/
-void __init torture_init_begin(char *ttype, bool v, int *runnable)
+bool __init torture_init_begin(char *ttype, bool v, int *runnable)
{
mutex_lock(&fullstop_mutex);
+ if (torture_type != NULL) {
+ pr_alert("torture_init_begin: refusing %s init: %s running",
+ ttype, torture_type);
+ mutex_unlock(&fullstop_mutex);
+ return false;
+ }
torture_type = ttype;
verbose = v;
torture_runnable = runnable;
fullstop = FULLSTOP_DONTSTOP;
-
+ return true;
}
EXPORT_SYMBOL_GPL(torture_init_begin);
@@ -645,6 +651,9 @@ bool torture_cleanup(void)
torture_shuffle_cleanup();
torture_stutter_cleanup();
torture_onoff_cleanup();
+ mutex_lock(&fullstop_mutex);
+ torture_type = NULL;
+ mutex_unlock(&fullstop_mutex);
return false;
}
EXPORT_SYMBOL_GPL(torture_cleanup);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 44/45] torture: Remove __init from torture_init_begin/end
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (41 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 43/45] torture: Check for multiple concurrent torture tests Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 45/45] torture: Remove unused definition Paul E. McKenney
2014-05-07 21:16 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer josh
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Pranith Kumar, Paul E. McKenney
From: Pranith Kumar <bobby.prani@gmail.com>
Loading rcutorture as a module (as opposed to building it directly into
the kernel) results in the following splat:
[Wed Apr 16 15:29:33 2014] BUG: unable to handle kernel paging request at ffffffffa0003000
[Wed Apr 16 15:29:33 2014] IP: [<ffffffffa0003000>] 0xffffffffa0003000
[Wed Apr 16 15:29:33 2014] PGD 1c0f067 PUD 1c10063 PMD 378a6067 PTE 0
[Wed Apr 16 15:29:33 2014] Oops: 0010 [#1] SMP
[Wed Apr 16 15:29:33 2014] Modules linked in: rcutorture(+) torture
[Wed Apr 16 15:29:33 2014] CPU: 0 PID: 4257 Comm: modprobe Not tainted 3.15.0-rc1 #10
[Wed Apr 16 15:29:33 2014] Hardware name: innotek GmbH VirtualBox, BIOS VirtualBox 12/01/2006
[Wed Apr 16 15:29:33 2014] task: ffff8800db1e88d0 ti: ffff8800db25c000 task.ti: ffff8800db25c000
[Wed Apr 16 15:29:33 2014] RIP: 0010:[<ffffffffa0003000>] [<ffffffffa0003000>] 0xffffffffa0003000
[Wed Apr 16 15:29:33 2014] RSP: 0018:ffff8800db25dca0 EFLAGS: 00010282
[Wed Apr 16 15:29:33 2014] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[Wed Apr 16 15:29:33 2014] RDX: ffffffffa00090a8 RSI: 0000000000000001 RDI: ffffffffa0008337
[Wed Apr 16 15:29:33 2014] RBP: ffff8800db25dd50 R08: 0000000000000000 R09: 0000000000000000
[Wed Apr 16 15:29:33 2014] R10: ffffea000357b680 R11: ffffffff8113257a R12: ffffffffa000d000
[Wed Apr 16 15:29:33 2014] R13: ffffffffa00094c0 R14: ffffffffa0009510 R15: 0000000000000001
[Wed Apr 16 15:29:33 2014] FS: 00007fee30ce5700(0000) GS:ffff88021fc00000(0000) knlGS:0000000000000000
[Wed Apr 16 15:29:33 2014] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[Wed Apr 16 15:29:33 2014] CR2: ffffffffa0003000 CR3: 00000000d5eb1000 CR4: 00000000000006f0
[Wed Apr 16 15:29:33 2014] Stack:
[Wed Apr 16 15:29:33 2014] ffffffffa000d02c 0000000000000000 ffff88021700d400 0000000000000000
[Wed Apr 16 15:29:33 2014] ffff8800db25dd40 ffffffff81647951 ffff8802162bd000 ffff88021541846c
[Wed Apr 16 15:29:33 2014] 0000000000000000 ffffffff817dbe2d ffffffff817dbe2d 0000000000000001
[Wed Apr 16 15:29:33 2014] Call Trace:
[Wed Apr 16 15:29:33 2014] [<ffffffffa000d02c>] ? rcu_torture_init+0x2c/0x8b4 [rcutorture]
[Wed Apr 16 15:29:33 2014] [<ffffffff81647951>] ? netlink_broadcast_filtered+0x121/0x3a0
[Wed Apr 16 15:29:33 2014] [<ffffffff817dbe2d>] ? mutex_lock+0xd/0x2a
[Wed Apr 16 15:29:33 2014] [<ffffffff817dbe2d>] ? mutex_lock+0xd/0x2a
[Wed Apr 16 15:29:33 2014] [<ffffffff810e7022>] ? trace_module_notify+0x62/0x1d0
[Wed Apr 16 15:29:33 2014] [<ffffffffa000d000>] ? 0xffffffffa000cfff
[Wed Apr 16 15:29:33 2014] [<ffffffff8100034a>] do_one_initcall+0xfa/0x140
[Wed Apr 16 15:29:33 2014] [<ffffffff8106b4ce>] ? __blocking_notifier_call_chain+0x5e/0x80
[Wed Apr 16 15:29:33 2014] [<ffffffff810b3481>] load_module+0x1931/0x21b0
[Wed Apr 16 15:29:33 2014] [<ffffffff810b0330>] ? show_initstate+0x50/0x50
[Wed Apr 16 15:29:33 2014] [<ffffffff810b3d9e>] SyS_init_module+0x9e/0xc0
[Wed Apr 16 15:29:33 2014] [<ffffffff817e4c22>] system_call_fastpath+0x16/0x1b
[Wed Apr 16 15:29:33 2014] Code: Bad RIP value.
[Wed Apr 16 15:29:33 2014] RIP [<ffffffffa0003000>] 0xffffffffa0003000
[Wed Apr 16 15:29:33 2014] RSP <ffff8800db25dca0>
[Wed Apr 16 15:29:33 2014] CR2: ffffffffa0003000
[Wed Apr 16 15:29:33 2014] ---[ end trace 3e88c173037af84b ]---
This splat is due to the fact that torture_init_begin() and
torture_init_end() are both marked with __init, despite their use
at runtime. This commit therefore removes __init from both functions.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/torture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/torture.c b/kernel/torture.c
index de440a46331c..db8de702abbc 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -599,7 +599,7 @@ static void torture_stutter_cleanup(void)
* The runnable parameter points to a flag that controls whether or not
* the test is currently runnable. If there is no such flag, pass in NULL.
*/
-bool __init torture_init_begin(char *ttype, bool v, int *runnable)
+bool torture_init_begin(char *ttype, bool v, int *runnable)
{
mutex_lock(&fullstop_mutex);
if (torture_type != NULL) {
@@ -619,7 +619,7 @@ EXPORT_SYMBOL_GPL(torture_init_begin);
/*
* Tell the torture module that initialization is complete.
*/
-void __init torture_init_end(void)
+void torture_init_end(void)
{
mutex_unlock(&fullstop_mutex);
register_reboot_notifier(&torture_shutdown_nb);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [PATCH tip/core/rcu 45/45] torture: Remove unused definition
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (42 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 44/45] torture: Remove __init from torture_init_begin/end Paul E. McKenney
@ 2014-04-29 0:25 ` Paul E. McKenney
2014-05-07 21:16 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer josh
44 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-04-29 0:25 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, dhowells, edumazet, darren, fweisbec, oleg, sbw,
Pranith Kumar, Pranith Kumar, Paul E. McKenney
From: Pranith Kumar <pranith@gatech.edu>
The torture_parm() macro is the same as torture_param(), and torture_parm()
is not used. This commit therefore removes torture_parm().
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/torture.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h
index f998574247fd..5ca58fcbaf1b 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -49,12 +49,6 @@
#define VERBOSE_TOROUT_ERRSTRING(s) \
do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0)
-/* Definitions for a non-string torture-test module parameter. */
-#define torture_parm(type, name, init, msg) \
- static type name = init; \
- module_param(name, type, 0444); \
- MODULE_PARM_DESC(name, msg);
-
/* Definitions for online/offline exerciser. */
int torture_onoff_init(long ooholdoff, long oointerval);
char *torture_onoff_stats(char *page);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
` (43 preceding siblings ...)
2014-04-29 0:25 ` [PATCH tip/core/rcu 45/45] torture: Remove unused definition Paul E. McKenney
@ 2014-05-07 21:16 ` josh
2014-05-07 23:43 ` Paul E. McKenney
44 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:16 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The rcutorture output currently does not distinguish between stalls in
> the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> This commit therefore adds some diagnostics to help distinguish between
> these two conditions, at least for the non-SRCU implementations. (SRCU
> does not provide evidence of update-side forward progress by design.)
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
The concept makes sense, and the writer state annotations seem like a
useful debugging mechanism, but having RCU know about RCU torture types
seems fundamentally wrong. This mechanism accesses rcu_state, which is
already implementation-specific, so why not just only define the
function for the RCU implementations that support it, and then have a
function pointer in the torture-test structure to report a stall?
- Josh Triplett
> include/linux/rcupdate.h | 19 +++++++++++++++++++
> kernel/rcu/rcutorture.c | 37 +++++++++++++++++++++++++++++++++++++
> kernel/rcu/tree.c | 18 ++++++++++++++++++
> 3 files changed, 74 insertions(+)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 00a7fd61b3c6..a6c3898e141e 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -51,7 +51,17 @@ extern int rcu_expedited; /* for sysctl */
> extern int rcutorture_runnable; /* for sysctl */
> #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
>
> +enum rcutorture_type {
> + RTORT_BUSTED,
> + RTORT_RCU,
> + RTORT_RCU_BH,
> + RTORT_RCU_SCHED,
> + RTORT_SRCU
> +};
> +
> #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
> +void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
> + unsigned long *gpnum, unsigned long *completed);
> void rcutorture_record_test_transition(void);
> void rcutorture_record_progress(unsigned long vernum);
> void do_trace_rcu_torture_read(const char *rcutorturename,
> @@ -60,6 +70,15 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
> unsigned long c_old,
> unsigned long c);
> #else
> +static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
> + int *flags,
> + unsigned long *gpnum,
> + unsigned long *completed)
> +{
> + *flags = 0;
> + *gpnum = 0;
> + *completed = 0;
> +}
> static inline void rcutorture_record_test_transition(void)
> {
> }
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index bd30bc61bc05..1110db210318 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -138,6 +138,15 @@ static long n_barrier_attempts;
> static long n_barrier_successes;
> static struct list_head rcu_torture_removed;
>
> +static int rcu_torture_writer_state;
> +#define RTWS_FIXED_DELAY 0
> +#define RTWS_DELAY 1
> +#define RTWS_REPLACE 2
> +#define RTWS_DEF_FREE 3
> +#define RTWS_EXP_SYNC 4
> +#define RTWS_STUTTER 5
> +#define RTWS_STOPPING 6
> +
> #if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
> #define RCUTORTURE_RUNNABLE_INIT 1
> #else
> @@ -214,6 +223,7 @@ rcu_torture_free(struct rcu_torture *p)
> */
>
> struct rcu_torture_ops {
> + int ttype;
> void (*init)(void);
> int (*readlock)(void);
> void (*read_delay)(struct torture_random_state *rrsp);
> @@ -312,6 +322,7 @@ static void rcu_sync_torture_init(void)
> }
>
> static struct rcu_torture_ops rcu_ops = {
> + .ttype = RTORT_RCU,
> .init = rcu_sync_torture_init,
> .readlock = rcu_torture_read_lock,
> .read_delay = rcu_read_delay,
> @@ -355,6 +366,7 @@ static void rcu_bh_torture_deferred_free(struct rcu_torture *p)
> }
>
> static struct rcu_torture_ops rcu_bh_ops = {
> + .ttype = RTORT_RCU_BH,
> .init = rcu_sync_torture_init,
> .readlock = rcu_bh_torture_read_lock,
> .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> @@ -397,6 +409,7 @@ call_rcu_busted(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
> }
>
> static struct rcu_torture_ops rcu_busted_ops = {
> + .ttype = RTORT_BUSTED,
> .init = rcu_sync_torture_init,
> .readlock = rcu_torture_read_lock,
> .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> @@ -492,6 +505,7 @@ static void srcu_torture_synchronize_expedited(void)
> }
>
> static struct rcu_torture_ops srcu_ops = {
> + .ttype = RTORT_SRCU,
> .init = rcu_sync_torture_init,
> .readlock = srcu_torture_read_lock,
> .read_delay = srcu_read_delay,
> @@ -527,6 +541,7 @@ static void rcu_sched_torture_deferred_free(struct rcu_torture *p)
> }
>
> static struct rcu_torture_ops sched_ops = {
> + .ttype = RTORT_RCU_SCHED,
> .init = rcu_sync_torture_init,
> .readlock = sched_torture_read_lock,
> .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> @@ -699,12 +714,15 @@ rcu_torture_writer(void *arg)
> set_user_nice(current, MAX_NICE);
>
> do {
> + rcu_torture_writer_state = RTWS_FIXED_DELAY;
> schedule_timeout_uninterruptible(1);
> rp = rcu_torture_alloc();
> if (rp == NULL)
> continue;
> rp->rtort_pipe_count = 0;
> + rcu_torture_writer_state = RTWS_DELAY;
> udelay(torture_random(&rand) & 0x3ff);
> + rcu_torture_writer_state = RTWS_REPLACE;
> old_rp = rcu_dereference_check(rcu_torture_current,
> current == writer_task);
> rp->rtort_mbtest = 1;
> @@ -721,8 +739,10 @@ rcu_torture_writer(void *arg)
> else
> exp = gp_exp;
> if (!exp) {
> + rcu_torture_writer_state = RTWS_DEF_FREE;
> cur_ops->deferred_free(old_rp);
> } else {
> + rcu_torture_writer_state = RTWS_EXP_SYNC;
> cur_ops->exp_sync();
> list_add(&old_rp->rtort_free,
> &rcu_torture_removed);
> @@ -743,8 +763,10 @@ rcu_torture_writer(void *arg)
> }
> }
> rcutorture_record_progress(++rcu_torture_current_version);
> + rcu_torture_writer_state = RTWS_STUTTER;
> stutter_wait("rcu_torture_writer");
> } while (!torture_must_stop());
> + rcu_torture_writer_state = RTWS_STOPPING;
> torture_kthread_stopping("rcu_torture_writer");
> return 0;
> }
> @@ -937,6 +959,7 @@ rcu_torture_printk(char *page)
> int i;
> long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
> long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
> + static unsigned long rtcv_snap = ULONG_MAX;
>
> for_each_possible_cpu(cpu) {
> for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
> @@ -997,6 +1020,20 @@ rcu_torture_printk(char *page)
> page += sprintf(page, "\n");
> if (cur_ops->stats)
> cur_ops->stats(page);
> + if (rtcv_snap == rcu_torture_current_version &&
> + rcu_torture_current != NULL) {
> + int __maybe_unused flags;
> + unsigned long __maybe_unused gpnum;
> + unsigned long __maybe_unused completed;
> +
> + rcutorture_get_gp_data(cur_ops->ttype,
> + &flags, &gpnum, &completed);
> + page += sprintf(page,
> + "??? Writer stall state %d g%lu c%lu f%#x\n",
> + rcu_torture_writer_state,
> + gpnum, completed, flags);
> + }
> + rtcv_snap = rcu_torture_current_version;
> }
>
> /*
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 0c47e300210a..032106df7391 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -294,6 +294,24 @@ void rcutorture_record_test_transition(void)
> EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
>
> /*
> + * Send along grace-period-related data for rcutorture diagnostics.
> + */
> +void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
> + unsigned long *gpnum, unsigned long *completed)
> +{
> + if (test_type == RTORT_SRCU || test_type == RTORT_BUSTED) {
> + *flags = 0;
> + *gpnum = 0;
> + *completed = 0;
> + return;
> + }
> + *flags = ACCESS_ONCE(rcu_state->gp_flags);
> + *gpnum = ACCESS_ONCE(rcu_state->gpnum);
> + *completed = ACCESS_ONCE(rcu_state->completed);
> +}
> +EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
> +
> +/*
> * Record the number of writer passes through the current rcutorture test.
> * This is also used to correlate debugfs tracing stats with the rcutorture
> * messages.
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 06/45] torture: Intensify locking test
2014-04-29 0:24 ` [PATCH tip/core/rcu 06/45] torture: Intensify locking test Paul E. McKenney
@ 2014-05-07 21:20 ` josh
2014-05-07 23:56 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:20 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:54PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The current lock_torture_writer() spends too much time sleeping and not
> enough time hammering locks, as in an eight-CPU test will often only be
> utilizing a CPU or two. This commit therefore makes lock_torture_writer()
> sleep less and hammer more.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
> kernel/locking/locktorture.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
> index f26b1a18e34e..b0d3e3c50672 100644
> --- a/kernel/locking/locktorture.c
> +++ b/kernel/locking/locktorture.c
> @@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg)
> set_user_nice(current, 19);
>
> do {
> - schedule_timeout_uninterruptible(1);
> + if ((torture_random(&rand) & 0xfffff) == 0)
> + schedule_timeout_uninterruptible(1);
That's a one-in-1048576 chance of sleeping for a jiffy; is that frequent
enough to even bother sleeping at all?
> cur_ops->writelock();
> if (WARN_ON_ONCE(lock_is_write_held))
> lwsp->n_write_lock_fail++;
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-04-29 0:24 ` [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified Paul E. McKenney
@ 2014-05-07 21:22 ` josh
2014-05-07 23:52 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:22 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> Some environments require some variation on "make defconfig" to initialize
> the .config file. This commit therefore adds a --defconfig argument to
> allow this to be specified. The default value is of course "defconfig".
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
<bikeshed color="blue">
"--defconfig randconfig" or "--defconfig allyesconfig" or similar seems
rather odd; how about calling it --kconfig or similar?
</bikeshed>
> tools/testing/selftests/rcutorture/bin/configinit.sh | 2 +-
> tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
> index a1be6e62add1..9c3f3d39b934 100755
> --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
> +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
> @@ -62,7 +62,7 @@ grep '^grep' < $T/u.sh > $T/upd.sh
> echo "cat - $c" >> $T/upd.sh
> make mrproper
> make $buildloc distclean > $builddir/Make.distclean 2>&1
> -make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1
> +make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
> mv $builddir/.config $builddir/.config.sav
> sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
> cp $builddir/.config $builddir/.config.new
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index a52a077ee258..59945b7793d9 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -38,6 +38,7 @@ dur=30
> dryrun=""
> KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
> PATH=${KVM}/bin:$PATH; export PATH
> +TORTURE_DEFCONFIG=defconfig
> TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
> RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
> TORTURE_SUITE=rcu
> @@ -56,6 +57,7 @@ usage () {
> echo " --configs \"config-file list\""
> echo " --cpus N"
> echo " --datestamp string"
> + echo " --defconfig string"
> echo " --dryrun sched|script"
> echo " --duration minutes"
> echo " --interactive"
> @@ -96,6 +98,11 @@ do
> ds=$2
> shift
> ;;
> + --defconfig)
> + checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
> + TORTURE_DEFCONFIG=$2
> + shift
> + ;;
> --dryrun)
> checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
> dryrun=$2
> @@ -259,6 +266,7 @@ END {
> # Generate a script to execute the tests in appropriate batches.
> cat << ___EOF___ > $T/script
> TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> +TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
> ___EOF___
> awk < $T/cfgcpu.pack \
> -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG
2014-04-29 0:24 ` [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG Paul E. McKenney
@ 2014-05-07 21:23 ` josh
2014-05-13 19:00 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:23 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:56PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> This commit makes the torture scripts a bit more RCU-independent.
You've also dropped unnecessary "export" calls; please document that in
the commit message. With that change:
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
> tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> index d8e68a5e4411..e838c775f709 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> @@ -60,7 +60,7 @@ then
> exit 2
> fi
> ncpus=`cpus2use.sh`
> -make O=$builddir -j$ncpus $RCU_KMAKE_ARG > $builddir/Make.out 2>&1
> +make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $builddir/Make.out 2>&1
> retval=$?
> if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
> then
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 59945b7793d9..04ad1f980dfe 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -40,7 +40,7 @@ KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
> PATH=${KVM}/bin:$PATH; export PATH
> TORTURE_DEFCONFIG=defconfig
> TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
> -RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
> +TORTURE_KMAKE_ARG=""
> TORTURE_SUITE=rcu
> resdir=""
> configs=""
> @@ -118,7 +118,7 @@ do
> ;;
> --kmake-arg)
> checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
> - RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
> + TORTURE_KMAKE_ARG="$2"
> shift
> ;;
> --kversion)
> @@ -376,7 +376,7 @@ then
> echo PATH="$PATH; export PATH"
> echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
> echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> - echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG"
> + echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
> echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY
2014-04-29 0:24 ` [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY Paul E. McKenney
@ 2014-05-07 21:24 ` josh
2014-05-13 19:01 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:24 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:58PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> This commit makes the torture scripts a bit more RCU-independent.
And removes unnecessary exports; please document that. With that
change:
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
> tools/testing/selftests/rcutorture/bin/kvm.sh | 9 ++++++---
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> 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 e82f4f201c8c..86e6ffe6df45 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> @@ -152,7 +152,7 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
> boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
>
> echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> -if test -n "$RCU_BUILDONLY"
> +if test -n "$TORTURE_BUILDONLY"
> then
> echo Build-only run specified, boot/test omitted.
> exit 0
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 08c90cba79d2..73c586f6bdf6 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -81,7 +81,7 @@ do
> shift
> ;;
> --buildonly)
> - RCU_BUILDONLY=1; export RCU_BUILDONLY
> + TORTURE_BUILDONLY=1
> ;;
> --configs)
> checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
> @@ -374,7 +374,7 @@ then
> echo KVM="$KVM; export KVM"
> echo KVPATH="$KVPATH; export KVPATH"
> echo PATH="$PATH; export PATH"
> - echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
> + echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
> echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> @@ -402,4 +402,7 @@ echo
> echo
> echo " --- `date` Test summary:"
> echo Results directory: $resdir/$ds
> -kvm-recheck.sh $resdir/$ds
> +if test -n "$TORTURE_BUILDONLY"
> +then
> + kvm-recheck.sh $resdir/$ds
> +fi
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
2014-04-29 0:24 ` [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE Paul E. McKenney
@ 2014-05-07 21:26 ` josh
2014-05-07 23:59 ` Paul E. McKenney
2014-05-07 21:27 ` josh
1 sibling, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:26 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:59PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> This commit makes the torture scripts a bit more RCU-independent.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Bug below; with that fixed,
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
[...]
> @@ -378,7 +378,8 @@ then
> echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> - echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
> + echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> + export TORTURE_QEMU_INTERACTIVE"
Don't break this line in the middle of your quoted string.
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
2014-04-29 0:24 ` [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE Paul E. McKenney
2014-05-07 21:26 ` josh
@ 2014-05-07 21:27 ` josh
2014-05-07 23:57 ` Paul E. McKenney
1 sibling, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:27 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:59PM -0700, Paul E. McKenney wrote:
> - if test -n "$RCU_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> + if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> then
> echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
> echo -netdev bridge,br=br0,id=net0
> - elif test -n "$RCU_QEMU_INTERACTIVE"
> + elif test -n "$TORTURE_QEMU_INTERACTIVE"
> then
> echo -net nic -net user
Not related to this patch, but: qemu defaults to -net nic -net user, so
you don't need to specify it.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC
2014-04-29 0:25 ` [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC Paul E. McKenney
@ 2014-05-07 21:27 ` josh
2014-05-07 23:59 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:27 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:00PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> This commit makes the torture scripts a bit more RCU-independent.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
One comment below; with or without that change:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/functions.sh | 6 +++---
> tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++--
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
> index 623939cf814e..41fb52b805e4 100644
> --- a/tools/testing/selftests/rcutorture/bin/functions.sh
> +++ b/tools/testing/selftests/rcutorture/bin/functions.sh
> @@ -124,7 +124,7 @@ identify_qemu_append () {
>
> # identify_qemu_args qemu-cmd serial-file
> #
> -# Output arguments for qemu arguments based on the RCU_QEMU_MAC
> +# Output arguments for qemu arguments based on the TORTURE_QEMU_MAC
> # and TORTURE_QEMU_INTERACTIVE environment variables.
> identify_qemu_args () {
> case "$1" in
> @@ -133,9 +133,9 @@ identify_qemu_args () {
> qemu-system-ppc64)
> echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
> echo -device spapr-vscsi
> - if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> + if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$TORTURE_QEMU_MAC"
> then
> - echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
> + echo -device spapr-vlan,netdev=net0,mac=$TORTURE_QEMU_MAC
> echo -netdev bridge,br=br0,id=net0
> elif test -n "$TORTURE_QEMU_INTERACTIVE"
> then
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 2f9605ed5b58..1a4a68c76914 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -128,7 +128,7 @@ do
> ;;
> --mac)
> checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
> - RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
> + TORTURE_QEMU_MAC=$2; export TORTURE_QEMU_MAC
Can't you drop this export the same way you did previous exports?
> shift
> ;;
> --no-initrd)
> @@ -380,7 +380,7 @@ then
> echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> export TORTURE_QEMU_INTERACTIVE"
> - echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
> + echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
> echo "mkdir -p "$resdir" || :"
> echo "mkdir $resdir/$ds"
> cat $T/script
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent
2014-04-29 0:25 ` [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent Paul E. McKenney
@ 2014-05-07 21:29 ` josh
2014-05-08 0:01 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:29 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:03PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The torture tests need to set specific values for their respective
> Kconfig options (e.g., CONFIG_LOCK_TORTURE_TEST), and must therefore
> filter any conflicting definitions from the Kconfig fragment
> file. Unfortunately, the code in kvm-build.sh was looking only for
> CONFIG_RCU_TORTURE_TEST. This commit therefore handles the general case
> of CONFIG_[A-Z]*TORTURE_TEST.
This doesn't match your code below, which includes an _ after the * .
Also, one nit below.
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
With the commit message fixed:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> index e838c775f709..6d0b76d918f4 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> @@ -45,7 +45,7 @@ T=/tmp/test-linux.sh.$$
> trap 'rm -rf $T' 0
> mkdir $T
>
> -cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config
> +cat ${config_template} | grep -v 'CONFIG_[A-Z]*_TORTURE_TEST' > $T/config
UUOC (useless use of cat): you can redirect from ${config_template}
rather than catting it.
> cat << ___EOF___ >> $T/config
> CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
> CONFIG_VIRTIO_PCI=y
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run
2014-04-29 0:25 ` [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run Paul E. McKenney
@ 2014-05-07 21:33 ` josh
2014-05-08 0:07 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:33 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:06PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> In a normal torture-test run, the script inherits its environment
> variables, but this does not work when producing a script that is
> to run later. Therefore, definitions and exports are prepended to
> a dryrun script but not to a script that is run immediately. This
> commit reconciles this by placing definitions and exports at the
> beginning of the script in both cases.
Cleanup idea, not needed in this commit: This has gotten sufficiently
long to warrant a loop over a list of environment variables, or possibly
a loop over all environment variable starting with TORTURE_* .
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/kvm.sh | 28 ++++++++++++---------------
> 1 file changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 8aa62a2dccb5..93a6c5a8517d 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -241,8 +241,19 @@ END {
>
> # Generate a script to execute the tests in appropriate batches.
> cat << ___EOF___ > $T/script
> -TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> +CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
> +KVM="$KVM"; export KVM
> +KVPATH="$KVPATH"; export KVPATH
> +PATH="$PATH"; export PATH
> +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_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> if ! test -e $resdir
> then
> mkdir -p "$resdir" || :
> @@ -371,21 +382,6 @@ ___EOF___
>
> if test "$dryrun" = script
> then
> - # Dump out the script, but define the environment variables that
> - # it needs to run standalone.
> - echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
> - echo KVM="$KVM; export KVM"
> - echo KVPATH="$KVPATH; export KVPATH"
> - echo PATH="$PATH; export PATH"
> - echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
> - echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> - echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> - echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD"
> - echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> - export TORTURE_QEMU_INTERACTIVE"
> - echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
> - echo "mkdir -p "$resdir" || :"
> - echo "mkdir $resdir/$ds"
> cat $T/script
> exit 0
> elif test "$dryrun" = sched
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound
2014-04-29 0:25 ` [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound Paul E. McKenney
@ 2014-05-07 21:34 ` josh
2014-05-08 0:08 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:34 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:07PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The srcu_torture_stats() function prints SRCU's per-CPU c[] array with
> an unsigned format, which means that the number one less than zero is
> a very large number. This commit therefore prints this array with a
> signed format in order to improve readability of the rcutorture output.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Nit below; with that:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> kernel/rcu/rcutorture.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 3845ea99ccd4..0141fcff6bb9 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -486,15 +486,16 @@ static void srcu_torture_barrier(void)
>
> static void srcu_torture_stats(char *page)
> {
> + long c0, c1;
> int cpu;
> int idx = srcu_ctl.completed & 0x1;
>
> page += sprintf(page, "%s%s per-CPU(idx=%d):",
> torture_type, TORTURE_FLAG, idx);
> for_each_possible_cpu(cpu) {
> - page += sprintf(page, " %d(%lu,%lu)", cpu,
> - per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx],
> - per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]);
> + c0 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx];
> + c1 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx];
> + page += sprintf(page, " %d(%ld,%ld)", cpu, c0, c1);
Nit: I'd suggest declaring the variables inside the loop, or not using
intermediate variables at all.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-04-29 0:25 ` [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping() Paul E. McKenney
@ 2014-05-07 21:37 ` josh
2014-05-10 0:13 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:37 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> Currently, torture_kthread_stopping() prints only the name of the
> kthread that is stopping, which can be unedifying. This commit therefore
> adds "Stopping" to make things more evident.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Feedback below.
> kernel/torture.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/torture.c b/kernel/torture.c
> index acc9afc2f26e..f329848c3eee 100644
> --- a/kernel/torture.c
> +++ b/kernel/torture.c
> @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> */
> void torture_kthread_stopping(char *title)
> {
> + char buf[128];
> +
> + snprintf(buf, sizeof(buf), "Stopping %s", title);
> if (verbose)
> - VERBOSE_TOROUT_STRING(title);
> + VERBOSE_TOROUT_STRING(buf);
This seems like a case where the macro has led to poorer code; rather
than using sprintf into a temporary buffer, this should just print.
Please consider fixing the output macros to allow formats, as the pr_*
macros do.
Also, why do you need "if (verbose)" if the name of the macro has
VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
(Another good reason not to create a unique verbosity level mechanism,
and to use the kernel mechanisms instead.)
> while (!kthread_should_stop()) {
> torture_shutdown_absorb(title);
> schedule_timeout_uninterruptible(1);
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu
2014-04-29 0:25 ` [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu Paul E. McKenney
@ 2014-05-07 21:59 ` josh
2014-05-13 23:03 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 21:59 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:09PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The current script does record qemu diagnostics, but the user has to
> know where to look for them. This commit therefore puts them into the
> Warnings file so that kvm-recheck.sh will display them. This change is
> especially useful if you are in the habit of killing the qemu process
> when you realize that you messed something up, but then later on wonder
> why the process terminated early.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
A couple of issues below.
> @@ -172,6 +172,14 @@ do
> if test $kruntime -lt $seconds
> then
> echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
> + grep "^(qemu) qemu:" $resdir/kvm-test-1-run.sh.out >> $resdir/Warnings 2>&1
> + killpid="`grep "^(qemu) qemu: terminating on signal [0-9]* from pid" $resdir/kvm-test-1-run.sh.out`"
You already searched for lines like this and put them in Warnings in the
previous line, so you don't need to search the entire output. Also, you
use grep here and sed below; you could just use sed here to directly
obtain the PID:
killpid="$(sed -n "s/^(qemu) qemu: terminating on signal [0-9]* from pid \([0-9]*\).*$/\1/p" $resdir/Warnings)"
> + if test -n "$killpid"
> + then
> + pscmd="`echo $killpid | sed -e 's/^.*from pid/ps -ef | grep/'`"
> + echo $pscmd >> $resdir/Warnings
> + echo $pscmd | sh >> $resdir/Warnings 2>&1
> + fi
Grepping for a PID is a bad idea; it'll turn up anything that contains
that PID anywhere on the line, including as a substring. Given the
above change to obtain a numeric $killpid, you can instead pass the PID
to ps directly:
if test -n "$killpid"
then
ps -fp $killpid >> $resdir/Warnings 2>&1
fi
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture
2014-04-29 0:25 ` [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture Paul E. McKenney
@ 2014-05-07 22:02 ` josh
2014-05-10 0:31 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 22:02 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:12PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> Currently, the scripts hard-code arch/x86/boot/bzImage, which does not
> work well for other architectures. This commit therefore provides a
> identify_boot_image function that selects the correct bzImage location
> relative to the top of the Linux source tree. This commit also adds a
> --bootimage argument that allows selecting some other file, for example,
> "vmlinux".
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Two issues below; with those fixed,
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> tools/testing/selftests/rcutorture/bin/functions.sh | 21 +++++++++++++++++++++
> .../selftests/rcutorture/bin/kvm-test-1-run.sh | 11 +++++------
> tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
> 3 files changed, 34 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
> index 6b2adb29b073..efa95867e1cc 100644
> --- a/tools/testing/selftests/rcutorture/bin/functions.sh
> +++ b/tools/testing/selftests/rcutorture/bin/functions.sh
> @@ -76,6 +76,27 @@ configfrag_hotplug_cpu () {
> grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
> }
>
> +# identify_boot_image qemu-cmd
> +#
> +# Returns the relative path to the kernel build image. This will be
> +# arch/<arch>/boot/bzImage unless overridden with the TORTURE_BOOT_IMAGE
> +# environment variable.
> +identify_boot_image () {
> + if test -n "$TORTURE_BOOT_IMAGE"
> + then
> + echo $TORTURE_BOOT_IMAGE
> + else
> + case "$1" in
> + qemu-system-x86_64|qemu-system-i386)
> + echo arch/x86/boot/bzImage
> + ;;
> + qemu-system-ppc64)
> + echo arch/powerpc/boot/bzImage
> + ;;
*)
(fail noisily rather than silently)
> + esac
> + fi
> +}
> +
> # identify_qemu builddir
> #
> # Returns our best guess as to which qemu command is appropriate for
> 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 7848227aa4c1..7a95f86cc85a 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> @@ -94,9 +94,11 @@ fi
> # CONFIG_YENTA=n
> if kvm-build.sh $config_template $builddir $T
> then
> + QEMU="`identify_qemu $builddir/vmlinux`"
> + BOOT_IMAGE="`identify_boot_image $QEMU`"
> cp $builddir/Make*.out $resdir
> cp $builddir/.config $resdir
> - cp $builddir/arch/x86/boot/bzImage $resdir
> + cp $builddir/$BOOT_IMAGE $resdir
> parse-build.sh $resdir/Make.out $title
> if test -f $builddir.wait
> then
> @@ -124,9 +126,6 @@ cd $KVM
> kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
> echo ' ---' `date`: Starting kernel
>
> -# Determine the appropriate flavor of qemu command.
> -QEMU="`identify_qemu $builddir/vmlinux`"
> -
This change seems related but undocumented.
> # Generate -smp qemu argument.
> qemu_args="-nographic $qemu_args"
> cpu_count=`configNR_CPUS.sh $config_template`
> @@ -151,13 +150,13 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
> # Generate kernel-version-specific boot parameters
> boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
>
> -echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> +echo $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> if test -n "$TORTURE_BUILDONLY"
> then
> echo Build-only run specified, boot/test omitted.
> exit 0
> fi
> -$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> +$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> qemu_pid=$!
> commandcompleted=0
> echo Monitoring qemu job at pid $qemu_pid
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 9b838c372698..4eed2a4f42c7 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -39,6 +39,7 @@ 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_SUITE=rcu
> @@ -53,6 +54,7 @@ kversion=""
> 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\""
> echo " --cpus N"
> @@ -80,6 +82,11 @@ do
> 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
> ;;
> @@ -245,6 +252,7 @@ CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
> KVM="$KVM"; export KVM
> KVPATH="$KVPATH"; export KVPATH
> 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
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture
2014-04-29 0:25 ` [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture Paul E. McKenney
@ 2014-05-07 22:05 ` josh
2014-05-10 0:37 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 22:05 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:15PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> This commit allows rcutorture to print additional state for the
> RCU grace-period kthreads in cases where RCU seems reluctant to
> start a new grace period.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Should something reset gp_state after fqs finishes?
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> include/linux/rcutiny.h | 4 ++++
> include/linux/rcutree.h | 1 +
> kernel/rcu/rcutorture.c | 1 +
> kernel/rcu/tree.c | 17 +++++++++++++++++
> kernel/rcu/tree.h | 8 +++++++-
> 5 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
> index 425c659d54e5..d40a6a451330 100644
> --- a/include/linux/rcutiny.h
> +++ b/include/linux/rcutiny.h
> @@ -119,6 +119,10 @@ static inline void rcu_sched_force_quiescent_state(void)
> {
> }
>
> +static inline void show_rcu_gp_kthreads(void)
> +{
> +}
> +
> static inline void rcu_cpu_stall_reset(void)
> {
> }
> diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
> index a59ca05fd4e3..3e2f5d432743 100644
> --- a/include/linux/rcutree.h
> +++ b/include/linux/rcutree.h
> @@ -84,6 +84,7 @@ extern unsigned long rcutorture_vernum;
> long rcu_batches_completed(void);
> long rcu_batches_completed_bh(void);
> long rcu_batches_completed_sched(void);
> +void show_rcu_gp_kthreads(void);
>
> void rcu_force_quiescent_state(void);
> void rcu_bh_force_quiescent_state(void);
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 50c26a7b6d97..15af04177e7e 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -1033,6 +1033,7 @@ rcu_torture_printk(char *page)
> "??? Writer stall state %d g%lu c%lu f%#x\n",
> rcu_torture_writer_state,
> gpnum, completed, flags);
> + show_rcu_gp_kthreads();
> rcutorture_trace_dump();
> }
> rtcv_snap = rcu_torture_current_version;
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 032106df7391..3107bd935b2b 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -280,6 +280,21 @@ void rcu_bh_force_quiescent_state(void)
> EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state);
>
> /*
> + * Show the state of the grace-period kthreads.
> + */
> +void show_rcu_gp_kthreads(void)
> +{
> + struct rcu_state *rsp;
> +
> + for_each_rcu_flavor(rsp) {
> + pr_info("%s: wait state: %d ->state: %#lx\n",
> + rsp->name, rsp->gp_state, rsp->gp_kthread->state);
> + /* sched_show_task(rsp->gp_kthread); */
> + }
> +}
> +EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads);
> +
> +/*
> * Record the number of times rcutorture tests have been initiated and
> * terminated. This information allows the debugfs tracing stats to be
> * correlated to the rcutorture messages, even when the rcutorture module
> @@ -1611,6 +1626,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
> trace_rcu_grace_period(rsp->name,
> ACCESS_ONCE(rsp->gpnum),
> TPS("reqwait"));
> + rsp->gp_state = RCU_GP_WAIT_GPS;
> wait_event_interruptible(rsp->gp_wq,
> ACCESS_ONCE(rsp->gp_flags) &
> RCU_GP_FLAG_INIT);
> @@ -1638,6 +1654,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
> trace_rcu_grace_period(rsp->name,
> ACCESS_ONCE(rsp->gpnum),
> TPS("fqswait"));
> + rsp->gp_state = RCU_GP_WAIT_FQS;
> ret = wait_event_interruptible_timeout(rsp->gp_wq,
> ((gf = ACCESS_ONCE(rsp->gp_flags)) &
> RCU_GP_FLAG_FQS) ||
> diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
> index 75dc3c39a02a..c2fd1e722879 100644
> --- a/kernel/rcu/tree.h
> +++ b/kernel/rcu/tree.h
> @@ -406,7 +406,8 @@ struct rcu_state {
> unsigned long completed; /* # of last completed gp. */
> struct task_struct *gp_kthread; /* Task for grace periods. */
> wait_queue_head_t gp_wq; /* Where GP task waits. */
> - int gp_flags; /* Commands for GP task. */
> + short gp_flags; /* Commands for GP task. */
> + short gp_state; /* GP kthread sleep state. */
>
> /* End of fields guarded by root rcu_node's lock. */
>
> @@ -469,6 +470,11 @@ struct rcu_state {
> #define RCU_GP_FLAG_INIT 0x1 /* Need grace-period initialization. */
> #define RCU_GP_FLAG_FQS 0x2 /* Need grace-period quiescent-state forcing. */
>
> +/* Values for rcu_state structure's gp_flags field. */
> +#define RCU_GP_WAIT_INIT 0 /* Initial state. */
> +#define RCU_GP_WAIT_GPS 1 /* Wait for grace-period start. */
> +#define RCU_GP_WAIT_FQS 2 /* Wait for force-quiescent-state time. */
> +
> extern struct list_head rcu_struct_flavors;
>
> /* Sequence through rcu_state structures for each RCU flavor. */
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-04-29 0:25 ` [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures Paul E. McKenney
@ 2014-05-07 22:11 ` josh
2014-05-10 0:48 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 22:11 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> completely. This commit therefore prints "BUG: Build failed" in the
> summary at the end of a run.
This commit also changes a dozen other things about the output that this
commit message does not document. :)
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
> .../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
> .../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +-
> .../selftests/rcutorture/bin/kvm-recheck.sh | 24 ++++++++++++++++------
> .../selftests/rcutorture/bin/kvm-test-1-run.sh | 1 +
> 4 files changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> index 829186e19eb1..7f1ff1a8fc4b 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> @@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
> ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
> if test -z "$ncs"
> then
> - echo $configfile
> + echo "$configfile -------"
> else
> title="$configfile ------- $ncs acquisitions/releases"
> dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> index d75b1dc5ae53..307c4b95f325 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> @@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
> ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
> if test -z "$ngps"
> then
> - echo $configfile
> + echo "$configfile -------"
> else
> title="$configfile ------- $ngps grace periods"
> dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> index 26d78b7eaccf..ee1f6cae3d70 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> @@ -25,6 +25,7 @@
> # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
> +. tools/testing/selftests/rcutorture/bin/functions.sh
> for rd in "$@"
> do
> firsttime=1
> @@ -39,13 +40,24 @@ do
> fi
> TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
> kvm-recheck-${TORTURE_SUITE}.sh $i
> - configcheck.sh $i/.config $i/ConfigFragment
> - parse-build.sh $i/Make.out $configfile
> - parse-torture.sh $i/console.log $configfile
> - parse-console.sh $i/console.log $configfile
> - if test -r $i/Warnings
> + if test -f "$i/console.log"
> then
> - cat $i/Warnings
> + configcheck.sh $i/.config $i/ConfigFragment
> + parse-build.sh $i/Make.out $configfile
> + parse-torture.sh $i/console.log $configfile
> + parse-console.sh $i/console.log $configfile
> + if test -r $i/Warnings
> + then
> + cat $i/Warnings
> + fi
> + else
> + if test -f "$i/qemu-cmd"
> + then
> + print_bug qemu failed
> + else
> + print_bug Build failed
> + fi
> + echo " $i"
> fi
> done
> done
> 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 7a95f86cc85a..51c34a91a375 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> @@ -106,6 +106,7 @@ then
> fi
> else
> cp $builddir/Make*.out $resdir
> + cp $builddir/.config $resdir || :
> echo Build failed, not running KVM, see $resdir.
> if test -f $builddir.wait
> then
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-04-29 0:25 ` [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits Paul E. McKenney
@ 2014-05-07 22:17 ` josh
2014-05-10 0:51 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 22:17 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:27PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> The current scripting only keeps track of the git SHA-1 of the current
> HEAD. This can cause confusion in cases where testing ran in a git
> tree where changes had not yet been checked in. This commit therefore
> also records the output of "git diff HEAD" to provide the information
> needed to reconstruct the source tree that was tested.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Nit below.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 4eed2a4f42c7..91661845fdec 100644
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -277,6 +277,11 @@ if test -d .git
> then
> git status >> $resdir/$ds/testid.txt
> git rev-parse HEAD >> $resdir/$ds/testid.txt
> + git diff HEAD > $T/git-diff 2>&1
> + if test -s $T/git-diff
You don't need test here; you can use the return value of git diff.
> + then
> + cp $T/git-diff $resdir/$ds
> + fi
> fi
> ___EOF___
> awk < $T/cfgcpu.pack \
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 41/45] torture: Put qemu into the background
2014-04-29 0:25 ` [PATCH tip/core/rcu 41/45] torture: Put qemu into the background Paul E. McKenney
@ 2014-05-07 22:18 ` josh
2014-05-13 17:44 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-07 22:18 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:25:29PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> Currently, qemu runs in the foreground, which prevents the script from
> killing it in case the kernel locks up. This commit therefore places
> qemu into the background, allowing the script to recover from lockups.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
qemu originally did run in the background before this patch series;
please merge this into the patch that introduces the echo and thus
breaks that.
> tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 b1e85b049075..67e89f06e77f 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> @@ -157,7 +157,7 @@ then
> echo Build-only run specified, boot/test omitted.
> exit 0
> fi
> -$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> +( $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) &
> qemu_pid=$!
> commandcompleted=0
> echo Monitoring qemu job at pid $qemu_pid
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16
2014-04-29 0:24 [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
@ 2014-05-07 22:32 ` Josh Triplett
1 sibling, 0 replies; 106+ messages in thread
From: Josh Triplett @ 2014-05-07 22:32 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> Hello!
>
> This series provides torture-test updates:
>
> 1. Add forward-progress checking to distinguish between stalls in
> the RCU implementation and in the torture test itself.
>
> 2. Remove the --builddir and --relbuilddir options, which have been
> obsoleted by the parallel testing facility.
>
> 3. Make "--dryrun sched" output more readable by clearly indicating
> where each batch of concurrent runs starts.
>
> 4. Make torture-test errors less RCU-specific. ("Hey, why did
> my locktorture run complain about RCU???")
>
> 5,8-14. Rename variables to reflect the new RCU-independence of a number
> of the torture-test scripts.
>
> 6. Reduce locktorture sleeping to increase intensity.
>
> 7. Add a --defconfig argument to allow other default configs to
> be specified.
>
> 15. Make config-fragment filtering RCU-independent.
>
> 16. Mark private functions as static in kernel/rcu/torture.c,
> courtesy of Rashika Kheria.
>
> 17-18. Make the output of "--dryrun script" independently runnable.
>
> 19. Print negative numbers when SRCU counters wrap instead of
> huge 64-bit integers.
>
> 20. Fix "Stopping" torture messages.
>
> 21. Report any diagnostics issued by qemu.
>
> 22. Make kthreads spin during the last jiffy of a stutter period
> to increase the intensity of torture stop-start events.
>
> 23. Permit multiple qemu and boot arguments to be specified on
> the command line.
>
> 24. Choose bzImage location based on architecture.
>
> 25. Add tracing-enabled variant of TREE02 to aid debugging.
>
> 26. Dump the ftrace buffer when the RCU grace period stalls.
>
> 27. Export the RCU grace-period kthread wait state to rcutorture
> to ease diagnosis of RCU grace-period stalls.
>
> 28. Fix bug in raw_cpu_inc_return().
>
> 29. Make cond_resched() report RCU quiescent states.
>
> 30. Make rcu_torture_reader() use cond_resched() instead of
> unconditionally invoking schedule().
>
> 31. Complain if an all-zero cpumask is specified during a torture
> shuffle operation, courtesy of Iulia Manda.
>
> 32. Make build failures more evident.
>
> 33. Capture and report the torture_create_kthread() return value when
> creating the rcu_torture_fqs kthread.
>
> 34. Use elapsed time to detect hangs rather than counting "sleep 1"
> commands.
>
> 35. Rearrange config fragments to ensure that RCU-sched primitives are
> tested in TREE_PREEMPT_RCU kernels.
>
> 36. Add rcutorture tests for get_state_synchronize_rcu() and
> cond_synchronize_rcu().
>
> 37. Add explicit tests for synchronous grace-period primitives.
>
> 38. Add missing destroy_timer_on_stack(), courtesy of Thomas Gleixner.
>
> 39. Make scripts record "git diff HEAD" to ease reproduction of
> an unexpected torture-test result.
>
> 40. Run rcu_torture_writer() at normal priority.
>
> 41. Put the qemu process into the background to better handle
> kernel hangs.
>
> 42. Remove reference to a non-existent Kconfig parameter.
>
> 43. Refuse to run multiple concurrent torture tests.
>
> 44. Remove __init from torture_init_begin() and torture_init_end()
> to allow rcutorture to once again work as a loadable module.
>
> 45. Remove unused torture_parm() macro.
I responded with feedback on patches 1, 6, 7, 8, 10, 11, 12, 15, 18, 19,
20, 21, 24, 27, 32, 39, and 41.
For the remaining patches:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-07 21:16 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer josh
@ 2014-05-07 23:43 ` Paul E. McKenney
2014-05-09 15:52 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:43 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The rcutorture output currently does not distinguish between stalls in
> > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > This commit therefore adds some diagnostics to help distinguish between
> > these two conditions, at least for the non-SRCU implementations. (SRCU
> > does not provide evidence of update-side forward progress by design.)
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> The concept makes sense, and the writer state annotations seem like a
> useful debugging mechanism, but having RCU know about RCU torture types
> seems fundamentally wrong. This mechanism accesses rcu_state, which is
> already implementation-specific, so why not just only define the
> function for the RCU implementations that support it, and then have a
> function pointer in the torture-test structure to report a stall?
Ouch. It is worse than that! When running RCU-bh or RCU-sched,
the current code incorrectly returns the statistics for RCU.
So I do need some way for rcutorture to tell RCU which flavor
it is testing.
One thing I could do would be to pass in a pointer to the call_rcu()
function (cur_ops->call from rcutorture's viewpoint), then scan the
rcu_state structures looking for the selected flavor (rsp->call from
tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
not be found, and I could then just set everything to zero.
Does that seem reasonable, or is there a better way to do this?
Thanx, Paul
> - Josh Triplett
>
> > include/linux/rcupdate.h | 19 +++++++++++++++++++
> > kernel/rcu/rcutorture.c | 37 +++++++++++++++++++++++++++++++++++++
> > kernel/rcu/tree.c | 18 ++++++++++++++++++
> > 3 files changed, 74 insertions(+)
> >
> > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> > index 00a7fd61b3c6..a6c3898e141e 100644
> > --- a/include/linux/rcupdate.h
> > +++ b/include/linux/rcupdate.h
> > @@ -51,7 +51,17 @@ extern int rcu_expedited; /* for sysctl */
> > extern int rcutorture_runnable; /* for sysctl */
> > #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
> >
> > +enum rcutorture_type {
> > + RTORT_BUSTED,
> > + RTORT_RCU,
> > + RTORT_RCU_BH,
> > + RTORT_RCU_SCHED,
> > + RTORT_SRCU
> > +};
> > +
> > #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
> > +void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
> > + unsigned long *gpnum, unsigned long *completed);
> > void rcutorture_record_test_transition(void);
> > void rcutorture_record_progress(unsigned long vernum);
> > void do_trace_rcu_torture_read(const char *rcutorturename,
> > @@ -60,6 +70,15 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
> > unsigned long c_old,
> > unsigned long c);
> > #else
> > +static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
> > + int *flags,
> > + unsigned long *gpnum,
> > + unsigned long *completed)
> > +{
> > + *flags = 0;
> > + *gpnum = 0;
> > + *completed = 0;
> > +}
> > static inline void rcutorture_record_test_transition(void)
> > {
> > }
> > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> > index bd30bc61bc05..1110db210318 100644
> > --- a/kernel/rcu/rcutorture.c
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -138,6 +138,15 @@ static long n_barrier_attempts;
> > static long n_barrier_successes;
> > static struct list_head rcu_torture_removed;
> >
> > +static int rcu_torture_writer_state;
> > +#define RTWS_FIXED_DELAY 0
> > +#define RTWS_DELAY 1
> > +#define RTWS_REPLACE 2
> > +#define RTWS_DEF_FREE 3
> > +#define RTWS_EXP_SYNC 4
> > +#define RTWS_STUTTER 5
> > +#define RTWS_STOPPING 6
> > +
> > #if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
> > #define RCUTORTURE_RUNNABLE_INIT 1
> > #else
> > @@ -214,6 +223,7 @@ rcu_torture_free(struct rcu_torture *p)
> > */
> >
> > struct rcu_torture_ops {
> > + int ttype;
> > void (*init)(void);
> > int (*readlock)(void);
> > void (*read_delay)(struct torture_random_state *rrsp);
> > @@ -312,6 +322,7 @@ static void rcu_sync_torture_init(void)
> > }
> >
> > static struct rcu_torture_ops rcu_ops = {
> > + .ttype = RTORT_RCU,
> > .init = rcu_sync_torture_init,
> > .readlock = rcu_torture_read_lock,
> > .read_delay = rcu_read_delay,
> > @@ -355,6 +366,7 @@ static void rcu_bh_torture_deferred_free(struct rcu_torture *p)
> > }
> >
> > static struct rcu_torture_ops rcu_bh_ops = {
> > + .ttype = RTORT_RCU_BH,
> > .init = rcu_sync_torture_init,
> > .readlock = rcu_bh_torture_read_lock,
> > .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> > @@ -397,6 +409,7 @@ call_rcu_busted(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
> > }
> >
> > static struct rcu_torture_ops rcu_busted_ops = {
> > + .ttype = RTORT_BUSTED,
> > .init = rcu_sync_torture_init,
> > .readlock = rcu_torture_read_lock,
> > .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> > @@ -492,6 +505,7 @@ static void srcu_torture_synchronize_expedited(void)
> > }
> >
> > static struct rcu_torture_ops srcu_ops = {
> > + .ttype = RTORT_SRCU,
> > .init = rcu_sync_torture_init,
> > .readlock = srcu_torture_read_lock,
> > .read_delay = srcu_read_delay,
> > @@ -527,6 +541,7 @@ static void rcu_sched_torture_deferred_free(struct rcu_torture *p)
> > }
> >
> > static struct rcu_torture_ops sched_ops = {
> > + .ttype = RTORT_RCU_SCHED,
> > .init = rcu_sync_torture_init,
> > .readlock = sched_torture_read_lock,
> > .read_delay = rcu_read_delay, /* just reuse rcu's version. */
> > @@ -699,12 +714,15 @@ rcu_torture_writer(void *arg)
> > set_user_nice(current, MAX_NICE);
> >
> > do {
> > + rcu_torture_writer_state = RTWS_FIXED_DELAY;
> > schedule_timeout_uninterruptible(1);
> > rp = rcu_torture_alloc();
> > if (rp == NULL)
> > continue;
> > rp->rtort_pipe_count = 0;
> > + rcu_torture_writer_state = RTWS_DELAY;
> > udelay(torture_random(&rand) & 0x3ff);
> > + rcu_torture_writer_state = RTWS_REPLACE;
> > old_rp = rcu_dereference_check(rcu_torture_current,
> > current == writer_task);
> > rp->rtort_mbtest = 1;
> > @@ -721,8 +739,10 @@ rcu_torture_writer(void *arg)
> > else
> > exp = gp_exp;
> > if (!exp) {
> > + rcu_torture_writer_state = RTWS_DEF_FREE;
> > cur_ops->deferred_free(old_rp);
> > } else {
> > + rcu_torture_writer_state = RTWS_EXP_SYNC;
> > cur_ops->exp_sync();
> > list_add(&old_rp->rtort_free,
> > &rcu_torture_removed);
> > @@ -743,8 +763,10 @@ rcu_torture_writer(void *arg)
> > }
> > }
> > rcutorture_record_progress(++rcu_torture_current_version);
> > + rcu_torture_writer_state = RTWS_STUTTER;
> > stutter_wait("rcu_torture_writer");
> > } while (!torture_must_stop());
> > + rcu_torture_writer_state = RTWS_STOPPING;
> > torture_kthread_stopping("rcu_torture_writer");
> > return 0;
> > }
> > @@ -937,6 +959,7 @@ rcu_torture_printk(char *page)
> > int i;
> > long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
> > long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
> > + static unsigned long rtcv_snap = ULONG_MAX;
> >
> > for_each_possible_cpu(cpu) {
> > for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
> > @@ -997,6 +1020,20 @@ rcu_torture_printk(char *page)
> > page += sprintf(page, "\n");
> > if (cur_ops->stats)
> > cur_ops->stats(page);
> > + if (rtcv_snap == rcu_torture_current_version &&
> > + rcu_torture_current != NULL) {
> > + int __maybe_unused flags;
> > + unsigned long __maybe_unused gpnum;
> > + unsigned long __maybe_unused completed;
> > +
> > + rcutorture_get_gp_data(cur_ops->ttype,
> > + &flags, &gpnum, &completed);
> > + page += sprintf(page,
> > + "??? Writer stall state %d g%lu c%lu f%#x\n",
> > + rcu_torture_writer_state,
> > + gpnum, completed, flags);
> > + }
> > + rtcv_snap = rcu_torture_current_version;
> > }
> >
> > /*
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 0c47e300210a..032106df7391 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -294,6 +294,24 @@ void rcutorture_record_test_transition(void)
> > EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
> >
> > /*
> > + * Send along grace-period-related data for rcutorture diagnostics.
> > + */
> > +void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
> > + unsigned long *gpnum, unsigned long *completed)
> > +{
> > + if (test_type == RTORT_SRCU || test_type == RTORT_BUSTED) {
> > + *flags = 0;
> > + *gpnum = 0;
> > + *completed = 0;
> > + return;
> > + }
> > + *flags = ACCESS_ONCE(rcu_state->gp_flags);
> > + *gpnum = ACCESS_ONCE(rcu_state->gpnum);
> > + *completed = ACCESS_ONCE(rcu_state->completed);
> > +}
> > +EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
> > +
> > +/*
> > * Record the number of writer passes through the current rcutorture test.
> > * This is also used to correlate debugfs tracing stats with the rcutorture
> > * messages.
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-05-07 21:22 ` josh
@ 2014-05-07 23:52 ` Paul E. McKenney
2014-05-08 1:54 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:52 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:22:19PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > Some environments require some variation on "make defconfig" to initialize
> > the .config file. This commit therefore adds a --defconfig argument to
> > allow this to be specified. The default value is of course "defconfig".
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> <bikeshed color="blue">
> "--defconfig randconfig" or "--defconfig allyesconfig" or similar seems
> rather odd; how about calling it --kconfig or similar?
> </bikeshed>
Some day I am going to have to feed that to a browser and see what
happens. ;-)
I must confess that I hadn't considered feeding randconfig or allyesconfig
to that argument, partly because I figured that I would have to also
supply Kconfig constraints in those cases in order to ensure that the
resulting kernel would actually run under qemu. I was instead thinking
in terms of a --configs option beginning with "RAND", which would pick
up the Kconfig constraints from the appropriate configs directory,
for example:
tools/testing/selftests/rcutorture/configs/rcu/RAND1
That said, I haven't thought that far down that path.
So for the --defconfig argument, I was thinking more in terms of things
like pseries_defconfig or versatile_defconfig.
Thanx, Paul
> > tools/testing/selftests/rcutorture/bin/configinit.sh | 2 +-
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
> > 2 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
> > index a1be6e62add1..9c3f3d39b934 100755
> > --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
> > @@ -62,7 +62,7 @@ grep '^grep' < $T/u.sh > $T/upd.sh
> > echo "cat - $c" >> $T/upd.sh
> > make mrproper
> > make $buildloc distclean > $builddir/Make.distclean 2>&1
> > -make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1
> > +make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
> > mv $builddir/.config $builddir/.config.sav
> > sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
> > cp $builddir/.config $builddir/.config.new
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index a52a077ee258..59945b7793d9 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -38,6 +38,7 @@ dur=30
> > dryrun=""
> > KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
> > PATH=${KVM}/bin:$PATH; export PATH
> > +TORTURE_DEFCONFIG=defconfig
> > TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
> > RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
> > TORTURE_SUITE=rcu
> > @@ -56,6 +57,7 @@ usage () {
> > echo " --configs \"config-file list\""
> > echo " --cpus N"
> > echo " --datestamp string"
> > + echo " --defconfig string"
> > echo " --dryrun sched|script"
> > echo " --duration minutes"
> > echo " --interactive"
> > @@ -96,6 +98,11 @@ do
> > ds=$2
> > shift
> > ;;
> > + --defconfig)
> > + checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
> > + TORTURE_DEFCONFIG=$2
> > + shift
> > + ;;
> > --dryrun)
> > checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
> > dryrun=$2
> > @@ -259,6 +266,7 @@ END {
> > # Generate a script to execute the tests in appropriate batches.
> > cat << ___EOF___ > $T/script
> > TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> > +TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
> > ___EOF___
> > awk < $T/cfgcpu.pack \
> > -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 06/45] torture: Intensify locking test
2014-05-07 21:20 ` josh
@ 2014-05-07 23:56 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:56 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:20:15PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:54PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The current lock_torture_writer() spends too much time sleeping and not
> > enough time hammering locks, as in an eight-CPU test will often only be
> > utilizing a CPU or two. This commit therefore makes lock_torture_writer()
> > sleep less and hammer more.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > ---
> > kernel/locking/locktorture.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
> > index f26b1a18e34e..b0d3e3c50672 100644
> > --- a/kernel/locking/locktorture.c
> > +++ b/kernel/locking/locktorture.c
> > @@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg)
> > set_user_nice(current, 19);
> >
> > do {
> > - schedule_timeout_uninterruptible(1);
> > + if ((torture_random(&rand) & 0xfffff) == 0)
> > + schedule_timeout_uninterruptible(1);
>
> That's a one-in-1048576 chance of sleeping for a jiffy; is that frequent
> enough to even bother sleeping at all?
On large systems, maybe not. Smallish systems should be able to get
through that loop a million times in a few hundreds of milliseconds,
though. So longer term a smarter approach might be needed, but this
should be a good start.
Thanx, Paul
> > cur_ops->writelock();
> > if (WARN_ON_ONCE(lock_is_write_held))
> > lwsp->n_write_lock_fail++;
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
2014-05-07 21:27 ` josh
@ 2014-05-07 23:57 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:57 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:27:08PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:59PM -0700, Paul E. McKenney wrote:
> > - if test -n "$RCU_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> > + if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> > then
> > echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
> > echo -netdev bridge,br=br0,id=net0
> > - elif test -n "$RCU_QEMU_INTERACTIVE"
> > + elif test -n "$TORTURE_QEMU_INTERACTIVE"
> > then
> > echo -net nic -net user
>
> Not related to this patch, but: qemu defaults to -net nic -net user, so
> you don't need to specify it.
Good point, I wasn't aware of that. Paranoia will probably cause me
to leave it explicitly specified, though.
And yes, I freely admit that my paranoia is not evenly distributed. ;-)
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC
2014-05-07 21:27 ` josh
@ 2014-05-07 23:59 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:59 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:27:56PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:00PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > This commit makes the torture scripts a bit more RCU-independent.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> One comment below; with or without that change:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/functions.sh | 6 +++---
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++--
> > 2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
> > index 623939cf814e..41fb52b805e4 100644
> > --- a/tools/testing/selftests/rcutorture/bin/functions.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/functions.sh
> > @@ -124,7 +124,7 @@ identify_qemu_append () {
> >
> > # identify_qemu_args qemu-cmd serial-file
> > #
> > -# Output arguments for qemu arguments based on the RCU_QEMU_MAC
> > +# Output arguments for qemu arguments based on the TORTURE_QEMU_MAC
> > # and TORTURE_QEMU_INTERACTIVE environment variables.
> > identify_qemu_args () {
> > case "$1" in
> > @@ -133,9 +133,9 @@ identify_qemu_args () {
> > qemu-system-ppc64)
> > echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
> > echo -device spapr-vscsi
> > - if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
> > + if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$TORTURE_QEMU_MAC"
> > then
> > - echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
> > + echo -device spapr-vlan,netdev=net0,mac=$TORTURE_QEMU_MAC
> > echo -netdev bridge,br=br0,id=net0
> > elif test -n "$TORTURE_QEMU_INTERACTIVE"
> > then
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 2f9605ed5b58..1a4a68c76914 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -128,7 +128,7 @@ do
> > ;;
> > --mac)
> > checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
> > - RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
> > + TORTURE_QEMU_MAC=$2; export TORTURE_QEMU_MAC
>
> Can't you drop this export the same way you did previous exports?
Good point, will do!
Thanx, Paul
> > shift
> > ;;
> > --no-initrd)
> > @@ -380,7 +380,7 @@ then
> > echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> > echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> > export TORTURE_QEMU_INTERACTIVE"
> > - echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
> > + echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
> > echo "mkdir -p "$resdir" || :"
> > echo "mkdir $resdir/$ds"
> > cat $T/script
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE
2014-05-07 21:26 ` josh
@ 2014-05-07 23:59 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-07 23:59 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:26:09PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:59PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > This commit makes the torture scripts a bit more RCU-independent.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Bug below; with that fixed,
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> [...]
> > @@ -378,7 +378,8 @@ then
> > echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> > echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> > echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> > - echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
> > + echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> > + export TORTURE_QEMU_INTERACTIVE"
>
> Don't break this line in the middle of your quoted string.
Good point, will fix!
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent
2014-05-07 21:29 ` josh
@ 2014-05-08 0:01 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-08 0:01 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:29:37PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:03PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The torture tests need to set specific values for their respective
> > Kconfig options (e.g., CONFIG_LOCK_TORTURE_TEST), and must therefore
> > filter any conflicting definitions from the Kconfig fragment
> > file. Unfortunately, the code in kvm-build.sh was looking only for
> > CONFIG_RCU_TORTURE_TEST. This commit therefore handles the general case
> > of CONFIG_[A-Z]*TORTURE_TEST.
>
> This doesn't match your code below, which includes an _ after the * .
>
> Also, one nit below.
>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> With the commit message fixed:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > index e838c775f709..6d0b76d918f4 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > @@ -45,7 +45,7 @@ T=/tmp/test-linux.sh.$$
> > trap 'rm -rf $T' 0
> > mkdir $T
> >
> > -cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config
> > +cat ${config_template} | grep -v 'CONFIG_[A-Z]*_TORTURE_TEST' > $T/config
>
> UUOC (useless use of cat): you can redirect from ${config_template}
> rather than catting it.
Both good points! Back when I was first using UNIX, that extra "cat"
would have cost me something like three seconds. How quickly we forget! ;-)
Thanx, Paul
> > cat << ___EOF___ >> $T/config
> > CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
> > CONFIG_VIRTIO_PCI=y
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run
2014-05-07 21:33 ` josh
@ 2014-05-08 0:07 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-08 0:07 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:33:27PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:06PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > In a normal torture-test run, the script inherits its environment
> > variables, but this does not work when producing a script that is
> > to run later. Therefore, definitions and exports are prepended to
> > a dryrun script but not to a script that is run immediately. This
> > commit reconciles this by placing definitions and exports at the
> > beginning of the script in both cases.
>
> Cleanup idea, not needed in this commit: This has gotten sufficiently
> long to warrant a loop over a list of environment variables, or possibly
> a loop over all environment variable starting with TORTURE_* .
Makes sense on both counts, thank you! Give or take quoting, anyway! ;-)
Thanx, Paul
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 28 ++++++++++++---------------
> > 1 file changed, 12 insertions(+), 16 deletions(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 8aa62a2dccb5..93a6c5a8517d 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -241,8 +241,19 @@ END {
> >
> > # Generate a script to execute the tests in appropriate batches.
> > cat << ___EOF___ > $T/script
> > -TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> > +CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
> > +KVM="$KVM"; export KVM
> > +KVPATH="$KVPATH"; export KVPATH
> > +PATH="$PATH"; export PATH
> > +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_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
> > if ! test -e $resdir
> > then
> > mkdir -p "$resdir" || :
> > @@ -371,21 +382,6 @@ ___EOF___
> >
> > if test "$dryrun" = script
> > then
> > - # Dump out the script, but define the environment variables that
> > - # it needs to run standalone.
> > - echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
> > - echo KVM="$KVM; export KVM"
> > - echo KVPATH="$KVPATH; export KVPATH"
> > - echo PATH="$PATH; export PATH"
> > - echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
> > - echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> > - echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> > - echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD"
> > - echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE;
> > - export TORTURE_QEMU_INTERACTIVE"
> > - echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
> > - echo "mkdir -p "$resdir" || :"
> > - echo "mkdir $resdir/$ds"
> > cat $T/script
> > exit 0
> > elif test "$dryrun" = sched
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound
2014-05-07 21:34 ` josh
@ 2014-05-08 0:08 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-08 0:08 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:34:26PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:07PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The srcu_torture_stats() function prints SRCU's per-CPU c[] array with
> > an unsigned format, which means that the number one less than zero is
> > a very large number. This commit therefore prints this array with a
> > signed format in order to improve readability of the rcutorture output.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Nit below; with that:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > kernel/rcu/rcutorture.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> > index 3845ea99ccd4..0141fcff6bb9 100644
> > --- a/kernel/rcu/rcutorture.c
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -486,15 +486,16 @@ static void srcu_torture_barrier(void)
> >
> > static void srcu_torture_stats(char *page)
> > {
> > + long c0, c1;
> > int cpu;
> > int idx = srcu_ctl.completed & 0x1;
> >
> > page += sprintf(page, "%s%s per-CPU(idx=%d):",
> > torture_type, TORTURE_FLAG, idx);
> > for_each_possible_cpu(cpu) {
> > - page += sprintf(page, " %d(%lu,%lu)", cpu,
> > - per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx],
> > - per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]);
> > + c0 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx];
> > + c1 = (long)per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx];
> > + page += sprintf(page, " %d(%ld,%ld)", cpu, c0, c1);
>
> Nit: I'd suggest declaring the variables inside the loop, or not using
> intermediate variables at all.
Fair enough! Can't see that I am gaining much by them.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-05-07 23:52 ` Paul E. McKenney
@ 2014-05-08 1:54 ` Josh Triplett
2014-05-08 2:43 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-08 1:54 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 04:52:40PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 02:22:19PM -0700, josh@joshtriplett.org wrote:
> > On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > Some environments require some variation on "make defconfig" to initialize
> > > the .config file. This commit therefore adds a --defconfig argument to
> > > allow this to be specified. The default value is of course "defconfig".
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > <bikeshed color="blue">
> > "--defconfig randconfig" or "--defconfig allyesconfig" or similar seems
> > rather odd; how about calling it --kconfig or similar?
> > </bikeshed>
>
> Some day I am going to have to feed that to a browser and see what
> happens. ;-)
>
> I must confess that I hadn't considered feeding randconfig or allyesconfig
> to that argument, partly because I figured that I would have to also
> supply Kconfig constraints in those cases in order to ensure that the
> resulting kernel would actually run under qemu. I was instead thinking
> in terms of a --configs option beginning with "RAND", which would pick
> up the Kconfig constraints from the appropriate configs directory,
> for example:
>
> tools/testing/selftests/rcutorture/configs/rcu/RAND1
>
> That said, I haven't thought that far down that path.
>
> So for the --defconfig argument, I was thinking more in terms of things
> like pseries_defconfig or versatile_defconfig.
Ah, I see. --defconfig specifies the base configuration, while
--configs specifies the constraints. In that case, how about
--baseconfig? It might still make sense to pass --baseconfig
allnoconfig or --baseconfig allyesconfig or --baseconfig randconfig,
given a sufficiently complete constraints file.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-05-08 1:54 ` Josh Triplett
@ 2014-05-08 2:43 ` Paul E. McKenney
2014-05-08 7:47 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-08 2:43 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 06:54:08PM -0700, Josh Triplett wrote:
> On Wed, May 07, 2014 at 04:52:40PM -0700, Paul E. McKenney wrote:
> > On Wed, May 07, 2014 at 02:22:19PM -0700, josh@joshtriplett.org wrote:
> > > On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > Some environments require some variation on "make defconfig" to initialize
> > > > the .config file. This commit therefore adds a --defconfig argument to
> > > > allow this to be specified. The default value is of course "defconfig".
> > > >
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > >
> > > <bikeshed color="blue">
> > > "--defconfig randconfig" or "--defconfig allyesconfig" or similar seems
> > > rather odd; how about calling it --kconfig or similar?
> > > </bikeshed>
> >
> > Some day I am going to have to feed that to a browser and see what
> > happens. ;-)
> >
> > I must confess that I hadn't considered feeding randconfig or allyesconfig
> > to that argument, partly because I figured that I would have to also
> > supply Kconfig constraints in those cases in order to ensure that the
> > resulting kernel would actually run under qemu. I was instead thinking
> > in terms of a --configs option beginning with "RAND", which would pick
> > up the Kconfig constraints from the appropriate configs directory,
> > for example:
> >
> > tools/testing/selftests/rcutorture/configs/rcu/RAND1
> >
> > That said, I haven't thought that far down that path.
> >
> > So for the --defconfig argument, I was thinking more in terms of things
> > like pseries_defconfig or versatile_defconfig.
>
> Ah, I see. --defconfig specifies the base configuration, while
> --configs specifies the constraints. In that case, how about
> --baseconfig? It might still make sense to pass --baseconfig
> allnoconfig or --baseconfig allyesconfig or --baseconfig randconfig,
> given a sufficiently complete constraints file.
My choice of name was guided by the following:
$ find arch -name '*defconfig*' -print | wc -l
469
When I try baseconfig:
$ find arch -name '*baseconfig*' -print | wc -l
0
Don't get me wrong, you might be correct here. But the thing is that
I like being able to specify all tests in one go. That means that I
want to still be able to run my current defconfig-based config files
(e.g., TREE01) when I get a randconfig-based setup going. So I would
like to be able to specify something like:
sh kvm.sh --defconfig pseries_defconfig --configs "TREE01 RAND01"
But perhaps there is a better way to do this.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified
2014-05-08 2:43 ` Paul E. McKenney
@ 2014-05-08 7:47 ` Josh Triplett
0 siblings, 0 replies; 106+ messages in thread
From: Josh Triplett @ 2014-05-08 7:47 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 07:43:24PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 06:54:08PM -0700, Josh Triplett wrote:
> > On Wed, May 07, 2014 at 04:52:40PM -0700, Paul E. McKenney wrote:
> > > On Wed, May 07, 2014 at 02:22:19PM -0700, josh@joshtriplett.org wrote:
> > > > On Mon, Apr 28, 2014 at 05:24:55PM -0700, Paul E. McKenney wrote:
> > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > Some environments require some variation on "make defconfig" to initialize
> > > > > the .config file. This commit therefore adds a --defconfig argument to
> > > > > allow this to be specified. The default value is of course "defconfig".
> > > > >
> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > >
> > > > <bikeshed color="blue">
> > > > "--defconfig randconfig" or "--defconfig allyesconfig" or similar seems
> > > > rather odd; how about calling it --kconfig or similar?
> > > > </bikeshed>
> > >
> > > Some day I am going to have to feed that to a browser and see what
> > > happens. ;-)
> > >
> > > I must confess that I hadn't considered feeding randconfig or allyesconfig
> > > to that argument, partly because I figured that I would have to also
> > > supply Kconfig constraints in those cases in order to ensure that the
> > > resulting kernel would actually run under qemu. I was instead thinking
> > > in terms of a --configs option beginning with "RAND", which would pick
> > > up the Kconfig constraints from the appropriate configs directory,
> > > for example:
> > >
> > > tools/testing/selftests/rcutorture/configs/rcu/RAND1
> > >
> > > That said, I haven't thought that far down that path.
> > >
> > > So for the --defconfig argument, I was thinking more in terms of things
> > > like pseries_defconfig or versatile_defconfig.
> >
> > Ah, I see. --defconfig specifies the base configuration, while
> > --configs specifies the constraints. In that case, how about
> > --baseconfig? It might still make sense to pass --baseconfig
> > allnoconfig or --baseconfig allyesconfig or --baseconfig randconfig,
> > given a sufficiently complete constraints file.
>
> My choice of name was guided by the following:
>
> $ find arch -name '*defconfig*' -print | wc -l
> 469
>
> When I try baseconfig:
>
> $ find arch -name '*baseconfig*' -print | wc -l
> 0
>
> Don't get me wrong, you might be correct here. But the thing is that
> I like being able to specify all tests in one go. That means that I
> want to still be able to run my current defconfig-based config files
> (e.g., TREE01) when I get a randconfig-based setup going. So I would
> like to be able to specify something like:
>
> sh kvm.sh --defconfig pseries_defconfig --configs "TREE01 RAND01"
Fair enough.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-07 23:43 ` Paul E. McKenney
@ 2014-05-09 15:52 ` Josh Triplett
2014-05-09 17:36 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-09 15:52 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > The rcutorture output currently does not distinguish between stalls in
> > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > This commit therefore adds some diagnostics to help distinguish between
> > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > does not provide evidence of update-side forward progress by design.)
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > The concept makes sense, and the writer state annotations seem like a
> > useful debugging mechanism, but having RCU know about RCU torture types
> > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > already implementation-specific, so why not just only define the
> > function for the RCU implementations that support it, and then have a
> > function pointer in the torture-test structure to report a stall?
>
> Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> the current code incorrectly returns the statistics for RCU.
> So I do need some way for rcutorture to tell RCU which flavor
> it is testing.
>
> One thing I could do would be to pass in a pointer to the call_rcu()
> function (cur_ops->call from rcutorture's viewpoint), then scan the
> rcu_state structures looking for the selected flavor (rsp->call from
> tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> not be found, and I could then just set everything to zero.
>
> Does that seem reasonable, or is there a better way to do this?
That search seems rather too hackish; why not just declare one
stats-returning function per RCU flavor, and put the pointer to the
corresponding function in the structure for each test type?
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 15:52 ` Josh Triplett
@ 2014-05-09 17:36 ` Paul E. McKenney
2014-05-09 19:32 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-09 17:36 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > The rcutorture output currently does not distinguish between stalls in
> > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > This commit therefore adds some diagnostics to help distinguish between
> > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > does not provide evidence of update-side forward progress by design.)
> > > >
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > >
> > > The concept makes sense, and the writer state annotations seem like a
> > > useful debugging mechanism, but having RCU know about RCU torture types
> > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > already implementation-specific, so why not just only define the
> > > function for the RCU implementations that support it, and then have a
> > > function pointer in the torture-test structure to report a stall?
> >
> > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > the current code incorrectly returns the statistics for RCU.
> > So I do need some way for rcutorture to tell RCU which flavor
> > it is testing.
> >
> > One thing I could do would be to pass in a pointer to the call_rcu()
> > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > rcu_state structures looking for the selected flavor (rsp->call from
> > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > not be found, and I could then just set everything to zero.
> >
> > Does that seem reasonable, or is there a better way to do this?
>
> That search seems rather too hackish; why not just declare one
> stats-returning function per RCU flavor, and put the pointer to the
> corresponding function in the structure for each test type?
The problem is that rcutorture doesn't know anything about the structures,
as those are internal to the implementation. All it knows is which
functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
structures to modules (they are already non-static), then rename
TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
then do some special-case thing for SRCU, and put a pointer to whatever
in rcu_torture_ops, but that was feeling a bit hackish as well.
So what did you have in mind to allow rcutorture to communicate the
rcuflavor to the underlying RCU implementation?
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 17:36 ` Paul E. McKenney
@ 2014-05-09 19:32 ` Josh Triplett
2014-05-09 22:30 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-09 19:32 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > does not provide evidence of update-side forward progress by design.)
> > > > >
> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > >
> > > > The concept makes sense, and the writer state annotations seem like a
> > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > already implementation-specific, so why not just only define the
> > > > function for the RCU implementations that support it, and then have a
> > > > function pointer in the torture-test structure to report a stall?
> > >
> > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > the current code incorrectly returns the statistics for RCU.
> > > So I do need some way for rcutorture to tell RCU which flavor
> > > it is testing.
> > >
> > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > rcu_state structures looking for the selected flavor (rsp->call from
> > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > not be found, and I could then just set everything to zero.
> > >
> > > Does that seem reasonable, or is there a better way to do this?
> >
> > That search seems rather too hackish; why not just declare one
> > stats-returning function per RCU flavor, and put the pointer to the
> > corresponding function in the structure for each test type?
>
> The problem is that rcutorture doesn't know anything about the structures,
> as those are internal to the implementation. All it knows is which
> functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> structures to modules (they are already non-static), then rename
> TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> then do some special-case thing for SRCU, and put a pointer to whatever
> in rcu_torture_ops, but that was feeling a bit hackish as well.
>
> So what did you have in mind to allow rcutorture to communicate the
> rcuflavor to the underlying RCU implementation?
Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
(And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
a no-op version in rcutorture.)
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 19:32 ` Josh Triplett
@ 2014-05-09 22:30 ` Paul E. McKenney
2014-05-09 22:40 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-09 22:30 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > >
> > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > >
> > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > already implementation-specific, so why not just only define the
> > > > > function for the RCU implementations that support it, and then have a
> > > > > function pointer in the torture-test structure to report a stall?
> > > >
> > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > the current code incorrectly returns the statistics for RCU.
> > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > it is testing.
> > > >
> > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > not be found, and I could then just set everything to zero.
> > > >
> > > > Does that seem reasonable, or is there a better way to do this?
> > >
> > > That search seems rather too hackish; why not just declare one
> > > stats-returning function per RCU flavor, and put the pointer to the
> > > corresponding function in the structure for each test type?
> >
> > The problem is that rcutorture doesn't know anything about the structures,
> > as those are internal to the implementation. All it knows is which
> > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > structures to modules (they are already non-static), then rename
> > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > then do some special-case thing for SRCU, and put a pointer to whatever
> > in rcu_torture_ops, but that was feeling a bit hackish as well.
> >
> > So what did you have in mind to allow rcutorture to communicate the
> > rcuflavor to the underlying RCU implementation?
>
> Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> a no-op version in rcutorture.)
But that would require me to provide these same exports from TINY_RCU,
which does not need them.
How about exporting integers identifying the flavors of RCU to rcutorture,
which rcutorture can then pass to rcutorture_get_gp_data()? This allows
TINY_RCU to provide a trivial static inline function. TREE_RCU and
TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
rcu_state structure, with NULL pointers for flavors of RCU that don't
have any data to provide.
Would that help?
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 22:30 ` Paul E. McKenney
@ 2014-05-09 22:40 ` Josh Triplett
2014-05-09 22:55 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-09 22:40 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 03:30:04PM -0700, Paul E. McKenney wrote:
> On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> > On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > > >
> > > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > > >
> > > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > > >
> > > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > > already implementation-specific, so why not just only define the
> > > > > > function for the RCU implementations that support it, and then have a
> > > > > > function pointer in the torture-test structure to report a stall?
> > > > >
> > > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > > the current code incorrectly returns the statistics for RCU.
> > > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > > it is testing.
> > > > >
> > > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > > not be found, and I could then just set everything to zero.
> > > > >
> > > > > Does that seem reasonable, or is there a better way to do this?
> > > >
> > > > That search seems rather too hackish; why not just declare one
> > > > stats-returning function per RCU flavor, and put the pointer to the
> > > > corresponding function in the structure for each test type?
> > >
> > > The problem is that rcutorture doesn't know anything about the structures,
> > > as those are internal to the implementation. All it knows is which
> > > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > > structures to modules (they are already non-static), then rename
> > > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > > then do some special-case thing for SRCU, and put a pointer to whatever
> > > in rcu_torture_ops, but that was feeling a bit hackish as well.
> > >
> > > So what did you have in mind to allow rcutorture to communicate the
> > > rcuflavor to the underlying RCU implementation?
> >
> > Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> > EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> > (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> > get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> > a no-op version in rcutorture.)
>
> But that would require me to provide these same exports from TINY_RCU,
> which does not need them.
>
> How about exporting integers identifying the flavors of RCU to rcutorture,
> which rcutorture can then pass to rcutorture_get_gp_data()? This allows
> TINY_RCU to provide a trivial static inline function. TREE_RCU and
> TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
> rcu_state structure, with NULL pointers for flavors of RCU that don't
> have any data to provide.
>
> Would that help?
Either way seems fine: a single function with an extra parameter or a
unique function per flavor. But if you're going to provide the
RCU-flavor integers, they should be in RCU itself and refer to RCU
flavors, rather than being in rcutorture and refering to test types.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 22:40 ` Josh Triplett
@ 2014-05-09 22:55 ` Paul E. McKenney
2014-05-10 0:14 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-09 22:55 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 03:40:52PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 03:30:04PM -0700, Paul E. McKenney wrote:
> > On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> > > On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > > > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > > > >
> > > > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > > > >
> > > > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > > > >
> > > > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > > > already implementation-specific, so why not just only define the
> > > > > > > function for the RCU implementations that support it, and then have a
> > > > > > > function pointer in the torture-test structure to report a stall?
> > > > > >
> > > > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > > > the current code incorrectly returns the statistics for RCU.
> > > > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > > > it is testing.
> > > > > >
> > > > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > > > not be found, and I could then just set everything to zero.
> > > > > >
> > > > > > Does that seem reasonable, or is there a better way to do this?
> > > > >
> > > > > That search seems rather too hackish; why not just declare one
> > > > > stats-returning function per RCU flavor, and put the pointer to the
> > > > > corresponding function in the structure for each test type?
> > > >
> > > > The problem is that rcutorture doesn't know anything about the structures,
> > > > as those are internal to the implementation. All it knows is which
> > > > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > > > structures to modules (they are already non-static), then rename
> > > > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > > > then do some special-case thing for SRCU, and put a pointer to whatever
> > > > in rcu_torture_ops, but that was feeling a bit hackish as well.
> > > >
> > > > So what did you have in mind to allow rcutorture to communicate the
> > > > rcuflavor to the underlying RCU implementation?
> > >
> > > Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> > > EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> > > (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> > > get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> > > a no-op version in rcutorture.)
> >
> > But that would require me to provide these same exports from TINY_RCU,
> > which does not need them.
> >
> > How about exporting integers identifying the flavors of RCU to rcutorture,
> > which rcutorture can then pass to rcutorture_get_gp_data()? This allows
> > TINY_RCU to provide a trivial static inline function. TREE_RCU and
> > TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
> > rcu_state structure, with NULL pointers for flavors of RCU that don't
> > have any data to provide.
> >
> > Would that help?
>
> Either way seems fine: a single function with an extra parameter or a
> unique function per flavor. But if you're going to provide the
> RCU-flavor integers, they should be in RCU itself and refer to RCU
> flavors, rather than being in rcutorture and refering to test types.
Fair enough, will take that approach!
I am thinking in terms of something like the following:
RCU_FLAVOR
RCU_BH_FLAVOR
RCU_SCHED_FLAVOR
SRCU_FLAVOR
OTHER_FLAVOR
The "OTHER_FLAVOR" would be what rcutorture uses for the "busted"
incorrect-on-purpose flavor of RCU, which is local to rcutorture.
Seem reasonable, or would some other naming scheme be better?
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-05-07 21:37 ` josh
@ 2014-05-10 0:13 ` Paul E. McKenney
2014-05-10 0:16 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:13 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:37:36PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > Currently, torture_kthread_stopping() prints only the name of the
> > kthread that is stopping, which can be unedifying. This commit therefore
> > adds "Stopping" to make things more evident.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Feedback below.
>
> > kernel/torture.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/torture.c b/kernel/torture.c
> > index acc9afc2f26e..f329848c3eee 100644
> > --- a/kernel/torture.c
> > +++ b/kernel/torture.c
> > @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> > */
> > void torture_kthread_stopping(char *title)
> > {
> > + char buf[128];
> > +
> > + snprintf(buf, sizeof(buf), "Stopping %s", title);
> > if (verbose)
> > - VERBOSE_TOROUT_STRING(title);
> > + VERBOSE_TOROUT_STRING(buf);
>
> This seems like a case where the macro has led to poorer code; rather
> than using sprintf into a temporary buffer, this should just print.
> Please consider fixing the output macros to allow formats, as the pr_*
> macros do.
>
> Also, why do you need "if (verbose)" if the name of the macro has
> VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
> (Another good reason not to create a unique verbosity level mechanism,
> and to use the kernel mechanisms instead.)
Good catch, removed the redundant "if (verbose)".
My attempts in the past to leverage existing in-kernel verbosity controls
has caused problems such as the output appearing or not depending on
the distro in question.
Thanx, Paul
> > while (!kthread_should_stop()) {
> > torture_shutdown_absorb(title);
> > schedule_timeout_uninterruptible(1);
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-09 22:55 ` Paul E. McKenney
@ 2014-05-10 0:14 ` Josh Triplett
2014-05-10 0:31 ` Paul E. McKenney
2014-05-13 18:27 ` Paul E. McKenney
0 siblings, 2 replies; 106+ messages in thread
From: Josh Triplett @ 2014-05-10 0:14 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 03:55:14PM -0700, Paul E. McKenney wrote:
> On Fri, May 09, 2014 at 03:40:52PM -0700, Josh Triplett wrote:
> > On Fri, May 09, 2014 at 03:30:04PM -0700, Paul E. McKenney wrote:
> > > On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> > > > On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > > > > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > > > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > > > > >
> > > > > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > > > > >
> > > > > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > > > > >
> > > > > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > > > > already implementation-specific, so why not just only define the
> > > > > > > > function for the RCU implementations that support it, and then have a
> > > > > > > > function pointer in the torture-test structure to report a stall?
> > > > > > >
> > > > > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > > > > the current code incorrectly returns the statistics for RCU.
> > > > > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > > > > it is testing.
> > > > > > >
> > > > > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > > > > not be found, and I could then just set everything to zero.
> > > > > > >
> > > > > > > Does that seem reasonable, or is there a better way to do this?
> > > > > >
> > > > > > That search seems rather too hackish; why not just declare one
> > > > > > stats-returning function per RCU flavor, and put the pointer to the
> > > > > > corresponding function in the structure for each test type?
> > > > >
> > > > > The problem is that rcutorture doesn't know anything about the structures,
> > > > > as those are internal to the implementation. All it knows is which
> > > > > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > > > > structures to modules (they are already non-static), then rename
> > > > > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > > > > then do some special-case thing for SRCU, and put a pointer to whatever
> > > > > in rcu_torture_ops, but that was feeling a bit hackish as well.
> > > > >
> > > > > So what did you have in mind to allow rcutorture to communicate the
> > > > > rcuflavor to the underlying RCU implementation?
> > > >
> > > > Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> > > > EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> > > > (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> > > > get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> > > > a no-op version in rcutorture.)
> > >
> > > But that would require me to provide these same exports from TINY_RCU,
> > > which does not need them.
> > >
> > > How about exporting integers identifying the flavors of RCU to rcutorture,
> > > which rcutorture can then pass to rcutorture_get_gp_data()? This allows
> > > TINY_RCU to provide a trivial static inline function. TREE_RCU and
> > > TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
> > > rcu_state structure, with NULL pointers for flavors of RCU that don't
> > > have any data to provide.
> > >
> > > Would that help?
> >
> > Either way seems fine: a single function with an extra parameter or a
> > unique function per flavor. But if you're going to provide the
> > RCU-flavor integers, they should be in RCU itself and refer to RCU
> > flavors, rather than being in rcutorture and refering to test types.
>
> Fair enough, will take that approach!
>
> I am thinking in terms of something like the following:
>
> RCU_FLAVOR
> RCU_BH_FLAVOR
> RCU_SCHED_FLAVOR
> SRCU_FLAVOR
> OTHER_FLAVOR
>
> The "OTHER_FLAVOR" would be what rcutorture uses for the "busted"
> incorrect-on-purpose flavor of RCU, which is local to rcutorture.
>
> Seem reasonable, or would some other naming scheme be better?
Seems reasonable to me. I'd call the last one "INVALID_RCU_FLAVOR" or
similar.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-05-10 0:13 ` Paul E. McKenney
@ 2014-05-10 0:16 ` Josh Triplett
2014-05-10 0:42 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-10 0:16 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:13:46PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 02:37:36PM -0700, josh@joshtriplett.org wrote:
> > On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > Currently, torture_kthread_stopping() prints only the name of the
> > > kthread that is stopping, which can be unedifying. This commit therefore
> > > adds "Stopping" to make things more evident.
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > Feedback below.
> >
> > > kernel/torture.c | 5 ++++-
> > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/torture.c b/kernel/torture.c
> > > index acc9afc2f26e..f329848c3eee 100644
> > > --- a/kernel/torture.c
> > > +++ b/kernel/torture.c
> > > @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> > > */
> > > void torture_kthread_stopping(char *title)
> > > {
> > > + char buf[128];
> > > +
> > > + snprintf(buf, sizeof(buf), "Stopping %s", title);
> > > if (verbose)
> > > - VERBOSE_TOROUT_STRING(title);
> > > + VERBOSE_TOROUT_STRING(buf);
> >
> > This seems like a case where the macro has led to poorer code; rather
> > than using sprintf into a temporary buffer, this should just print.
> > Please consider fixing the output macros to allow formats, as the pr_*
> > macros do.
> >
> > Also, why do you need "if (verbose)" if the name of the macro has
> > VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
> > (Another good reason not to create a unique verbosity level mechanism,
> > and to use the kernel mechanisms instead.)
>
> Good catch, removed the redundant "if (verbose)".
>
> My attempts in the past to leverage existing in-kernel verbosity controls
> has caused problems such as the output appearing or not depending on
> the distro in question.
That aside, though, what do you think about making the macros accept
format strings and arguments, in the style of pr_* and pr_fmt?
- Josh Trpilett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture
2014-05-07 22:02 ` josh
@ 2014-05-10 0:31 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:31 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 03:02:46PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:12PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > Currently, the scripts hard-code arch/x86/boot/bzImage, which does not
> > work well for other architectures. This commit therefore provides a
> > identify_boot_image function that selects the correct bzImage location
> > relative to the top of the Linux source tree. This commit also adds a
> > --bootimage argument that allows selecting some other file, for example,
> > "vmlinux".
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Two issues below; with those fixed,
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > tools/testing/selftests/rcutorture/bin/functions.sh | 21 +++++++++++++++++++++
> > .../selftests/rcutorture/bin/kvm-test-1-run.sh | 11 +++++------
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 8 ++++++++
> > 3 files changed, 34 insertions(+), 6 deletions(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
> > index 6b2adb29b073..efa95867e1cc 100644
> > --- a/tools/testing/selftests/rcutorture/bin/functions.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/functions.sh
> > @@ -76,6 +76,27 @@ configfrag_hotplug_cpu () {
> > grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
> > }
> >
> > +# identify_boot_image qemu-cmd
> > +#
> > +# Returns the relative path to the kernel build image. This will be
> > +# arch/<arch>/boot/bzImage unless overridden with the TORTURE_BOOT_IMAGE
> > +# environment variable.
> > +identify_boot_image () {
> > + if test -n "$TORTURE_BOOT_IMAGE"
> > + then
> > + echo $TORTURE_BOOT_IMAGE
> > + else
> > + case "$1" in
> > + qemu-system-x86_64|qemu-system-i386)
> > + echo arch/x86/boot/bzImage
> > + ;;
> > + qemu-system-ppc64)
> > + echo arch/powerpc/boot/bzImage
> > + ;;
>
> *)
> (fail noisily rather than silently)
Good point, fixed here and in kvm-test-1-run.sh.
> > + esac
> > + fi
> > +}
> > +
> > # identify_qemu builddir
> > #
> > # Returns our best guess as to which qemu command is appropriate for
> > 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 7848227aa4c1..7a95f86cc85a 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > @@ -94,9 +94,11 @@ fi
> > # CONFIG_YENTA=n
> > if kvm-build.sh $config_template $builddir $T
> > then
> > + QEMU="`identify_qemu $builddir/vmlinux`"
> > + BOOT_IMAGE="`identify_boot_image $QEMU`"
> > cp $builddir/Make*.out $resdir
> > cp $builddir/.config $resdir
> > - cp $builddir/arch/x86/boot/bzImage $resdir
> > + cp $builddir/$BOOT_IMAGE $resdir
> > parse-build.sh $resdir/Make.out $title
> > if test -f $builddir.wait
> > then
> > @@ -124,9 +126,6 @@ cd $KVM
> > kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
> > echo ' ---' `date`: Starting kernel
> >
> > -# Determine the appropriate flavor of qemu command.
> > -QEMU="`identify_qemu $builddir/vmlinux`"
> > -
>
> This change seems related but undocumented.
Ah, the value of QEMU is needed above to figure out where to look for
the image. Added a sentence to that effect to the changelog.
Thanx, Paul
> > # Generate -smp qemu argument.
> > qemu_args="-nographic $qemu_args"
> > cpu_count=`configNR_CPUS.sh $config_template`
> > @@ -151,13 +150,13 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
> > # Generate kernel-version-specific boot parameters
> > boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
> >
> > -echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> > +echo $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> > if test -n "$TORTURE_BUILDONLY"
> > then
> > echo Build-only run specified, boot/test omitted.
> > exit 0
> > fi
> > -$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> > +$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> > qemu_pid=$!
> > commandcompleted=0
> > echo Monitoring qemu job at pid $qemu_pid
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 9b838c372698..4eed2a4f42c7 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -39,6 +39,7 @@ 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_SUITE=rcu
> > @@ -53,6 +54,7 @@ kversion=""
> > 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\""
> > echo " --cpus N"
> > @@ -80,6 +82,11 @@ do
> > 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
> > ;;
> > @@ -245,6 +252,7 @@ CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
> > KVM="$KVM"; export KVM
> > KVPATH="$KVPATH"; export KVPATH
> > 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
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-10 0:14 ` Josh Triplett
@ 2014-05-10 0:31 ` Paul E. McKenney
2014-05-13 18:27 ` Paul E. McKenney
1 sibling, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:31 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:14:54PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 03:55:14PM -0700, Paul E. McKenney wrote:
> > On Fri, May 09, 2014 at 03:40:52PM -0700, Josh Triplett wrote:
> > > On Fri, May 09, 2014 at 03:30:04PM -0700, Paul E. McKenney wrote:
> > > > On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> > > > > On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > > > > > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > > > > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > > > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > > > > > >
> > > > > > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > > > > > >
> > > > > > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > > > > > already implementation-specific, so why not just only define the
> > > > > > > > > function for the RCU implementations that support it, and then have a
> > > > > > > > > function pointer in the torture-test structure to report a stall?
> > > > > > > >
> > > > > > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > > > > > the current code incorrectly returns the statistics for RCU.
> > > > > > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > > > > > it is testing.
> > > > > > > >
> > > > > > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > > > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > > > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > > > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > > > > > not be found, and I could then just set everything to zero.
> > > > > > > >
> > > > > > > > Does that seem reasonable, or is there a better way to do this?
> > > > > > >
> > > > > > > That search seems rather too hackish; why not just declare one
> > > > > > > stats-returning function per RCU flavor, and put the pointer to the
> > > > > > > corresponding function in the structure for each test type?
> > > > > >
> > > > > > The problem is that rcutorture doesn't know anything about the structures,
> > > > > > as those are internal to the implementation. All it knows is which
> > > > > > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > > > > > structures to modules (they are already non-static), then rename
> > > > > > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > > > > > then do some special-case thing for SRCU, and put a pointer to whatever
> > > > > > in rcu_torture_ops, but that was feeling a bit hackish as well.
> > > > > >
> > > > > > So what did you have in mind to allow rcutorture to communicate the
> > > > > > rcuflavor to the underlying RCU implementation?
> > > > >
> > > > > Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> > > > > EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> > > > > (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> > > > > get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> > > > > a no-op version in rcutorture.)
> > > >
> > > > But that would require me to provide these same exports from TINY_RCU,
> > > > which does not need them.
> > > >
> > > > How about exporting integers identifying the flavors of RCU to rcutorture,
> > > > which rcutorture can then pass to rcutorture_get_gp_data()? This allows
> > > > TINY_RCU to provide a trivial static inline function. TREE_RCU and
> > > > TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
> > > > rcu_state structure, with NULL pointers for flavors of RCU that don't
> > > > have any data to provide.
> > > >
> > > > Would that help?
> > >
> > > Either way seems fine: a single function with an extra parameter or a
> > > unique function per flavor. But if you're going to provide the
> > > RCU-flavor integers, they should be in RCU itself and refer to RCU
> > > flavors, rather than being in rcutorture and refering to test types.
> >
> > Fair enough, will take that approach!
> >
> > I am thinking in terms of something like the following:
> >
> > RCU_FLAVOR
> > RCU_BH_FLAVOR
> > RCU_SCHED_FLAVOR
> > SRCU_FLAVOR
> > OTHER_FLAVOR
> >
> > The "OTHER_FLAVOR" would be what rcutorture uses for the "busted"
> > incorrect-on-purpose flavor of RCU, which is local to rcutorture.
> >
> > Seem reasonable, or would some other naming scheme be better?
>
> Seems reasonable to me. I'd call the last one "INVALID_RCU_FLAVOR" or
> similar.
Even better!
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture
2014-05-07 22:05 ` josh
@ 2014-05-10 0:37 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:37 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 03:05:31PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:15PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > This commit allows rcutorture to print additional state for the
> > RCU grace-period kthreads in cases where RCU seems reluctant to
> > start a new grace period.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Should something reset gp_state after fqs finishes?
If I need more debugging info later on, yes. ;-)
Thanx, Paul
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > include/linux/rcutiny.h | 4 ++++
> > include/linux/rcutree.h | 1 +
> > kernel/rcu/rcutorture.c | 1 +
> > kernel/rcu/tree.c | 17 +++++++++++++++++
> > kernel/rcu/tree.h | 8 +++++++-
> > 5 files changed, 30 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
> > index 425c659d54e5..d40a6a451330 100644
> > --- a/include/linux/rcutiny.h
> > +++ b/include/linux/rcutiny.h
> > @@ -119,6 +119,10 @@ static inline void rcu_sched_force_quiescent_state(void)
> > {
> > }
> >
> > +static inline void show_rcu_gp_kthreads(void)
> > +{
> > +}
> > +
> > static inline void rcu_cpu_stall_reset(void)
> > {
> > }
> > diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
> > index a59ca05fd4e3..3e2f5d432743 100644
> > --- a/include/linux/rcutree.h
> > +++ b/include/linux/rcutree.h
> > @@ -84,6 +84,7 @@ extern unsigned long rcutorture_vernum;
> > long rcu_batches_completed(void);
> > long rcu_batches_completed_bh(void);
> > long rcu_batches_completed_sched(void);
> > +void show_rcu_gp_kthreads(void);
> >
> > void rcu_force_quiescent_state(void);
> > void rcu_bh_force_quiescent_state(void);
> > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> > index 50c26a7b6d97..15af04177e7e 100644
> > --- a/kernel/rcu/rcutorture.c
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -1033,6 +1033,7 @@ rcu_torture_printk(char *page)
> > "??? Writer stall state %d g%lu c%lu f%#x\n",
> > rcu_torture_writer_state,
> > gpnum, completed, flags);
> > + show_rcu_gp_kthreads();
> > rcutorture_trace_dump();
> > }
> > rtcv_snap = rcu_torture_current_version;
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 032106df7391..3107bd935b2b 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -280,6 +280,21 @@ void rcu_bh_force_quiescent_state(void)
> > EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state);
> >
> > /*
> > + * Show the state of the grace-period kthreads.
> > + */
> > +void show_rcu_gp_kthreads(void)
> > +{
> > + struct rcu_state *rsp;
> > +
> > + for_each_rcu_flavor(rsp) {
> > + pr_info("%s: wait state: %d ->state: %#lx\n",
> > + rsp->name, rsp->gp_state, rsp->gp_kthread->state);
> > + /* sched_show_task(rsp->gp_kthread); */
> > + }
> > +}
> > +EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads);
> > +
> > +/*
> > * Record the number of times rcutorture tests have been initiated and
> > * terminated. This information allows the debugfs tracing stats to be
> > * correlated to the rcutorture messages, even when the rcutorture module
> > @@ -1611,6 +1626,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
> > trace_rcu_grace_period(rsp->name,
> > ACCESS_ONCE(rsp->gpnum),
> > TPS("reqwait"));
> > + rsp->gp_state = RCU_GP_WAIT_GPS;
> > wait_event_interruptible(rsp->gp_wq,
> > ACCESS_ONCE(rsp->gp_flags) &
> > RCU_GP_FLAG_INIT);
> > @@ -1638,6 +1654,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
> > trace_rcu_grace_period(rsp->name,
> > ACCESS_ONCE(rsp->gpnum),
> > TPS("fqswait"));
> > + rsp->gp_state = RCU_GP_WAIT_FQS;
> > ret = wait_event_interruptible_timeout(rsp->gp_wq,
> > ((gf = ACCESS_ONCE(rsp->gp_flags)) &
> > RCU_GP_FLAG_FQS) ||
> > diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
> > index 75dc3c39a02a..c2fd1e722879 100644
> > --- a/kernel/rcu/tree.h
> > +++ b/kernel/rcu/tree.h
> > @@ -406,7 +406,8 @@ struct rcu_state {
> > unsigned long completed; /* # of last completed gp. */
> > struct task_struct *gp_kthread; /* Task for grace periods. */
> > wait_queue_head_t gp_wq; /* Where GP task waits. */
> > - int gp_flags; /* Commands for GP task. */
> > + short gp_flags; /* Commands for GP task. */
> > + short gp_state; /* GP kthread sleep state. */
> >
> > /* End of fields guarded by root rcu_node's lock. */
> >
> > @@ -469,6 +470,11 @@ struct rcu_state {
> > #define RCU_GP_FLAG_INIT 0x1 /* Need grace-period initialization. */
> > #define RCU_GP_FLAG_FQS 0x2 /* Need grace-period quiescent-state forcing. */
> >
> > +/* Values for rcu_state structure's gp_flags field. */
> > +#define RCU_GP_WAIT_INIT 0 /* Initial state. */
> > +#define RCU_GP_WAIT_GPS 1 /* Wait for grace-period start. */
> > +#define RCU_GP_WAIT_FQS 2 /* Wait for force-quiescent-state time. */
> > +
> > extern struct list_head rcu_struct_flavors;
> >
> > /* Sequence through rcu_state structures for each RCU flavor. */
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-05-10 0:16 ` Josh Triplett
@ 2014-05-10 0:42 ` Paul E. McKenney
2014-05-10 3:46 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:42 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:16:57PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 05:13:46PM -0700, Paul E. McKenney wrote:
> > On Wed, May 07, 2014 at 02:37:36PM -0700, josh@joshtriplett.org wrote:
> > > On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > Currently, torture_kthread_stopping() prints only the name of the
> > > > kthread that is stopping, which can be unedifying. This commit therefore
> > > > adds "Stopping" to make things more evident.
> > > >
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > >
> > > Feedback below.
> > >
> > > > kernel/torture.c | 5 ++++-
> > > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/kernel/torture.c b/kernel/torture.c
> > > > index acc9afc2f26e..f329848c3eee 100644
> > > > --- a/kernel/torture.c
> > > > +++ b/kernel/torture.c
> > > > @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> > > > */
> > > > void torture_kthread_stopping(char *title)
> > > > {
> > > > + char buf[128];
> > > > +
> > > > + snprintf(buf, sizeof(buf), "Stopping %s", title);
> > > > if (verbose)
> > > > - VERBOSE_TOROUT_STRING(title);
> > > > + VERBOSE_TOROUT_STRING(buf);
> > >
> > > This seems like a case where the macro has led to poorer code; rather
> > > than using sprintf into a temporary buffer, this should just print.
> > > Please consider fixing the output macros to allow formats, as the pr_*
> > > macros do.
> > >
> > > Also, why do you need "if (verbose)" if the name of the macro has
> > > VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
> > > (Another good reason not to create a unique verbosity level mechanism,
> > > and to use the kernel mechanisms instead.)
> >
> > Good catch, removed the redundant "if (verbose)".
> >
> > My attempts in the past to leverage existing in-kernel verbosity controls
> > has caused problems such as the output appearing or not depending on
> > the distro in question.
>
> That aside, though, what do you think about making the macros accept
> format strings and arguments, in the style of pr_* and pr_fmt?
If I end up needing this in a few more cases, then it would indeed be
worth it.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-05-07 22:11 ` josh
@ 2014-05-10 0:48 ` Paul E. McKenney
2014-05-10 19:34 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:48 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 03:11:39PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> > completely. This commit therefore prints "BUG: Build failed" in the
> > summary at the end of a run.
>
> This commit also changes a dozen other things about the output that this
> commit message does not document. :)
Well, I don't know about a dozen, but I did upgrade the commit message to
read as follows:
The reaction of kvm-recheck.sh is obscure at best, and easy to
miss completely. This commit therefore prints "BUG: Build failed"
in the summary at the end of a run. This commit also adds the
line of dashes in cases where performance info is not available,
and also avoids printing nonsense diagnostics in cases where
some of the normal test output is not available.
Does that help?
Thanx, Paul
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > ---
> > .../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
> > .../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +-
> > .../selftests/rcutorture/bin/kvm-recheck.sh | 24 ++++++++++++++++------
> > .../selftests/rcutorture/bin/kvm-test-1-run.sh | 1 +
> > 4 files changed, 21 insertions(+), 8 deletions(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> > index 829186e19eb1..7f1ff1a8fc4b 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> > @@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
> > ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
> > if test -z "$ncs"
> > then
> > - echo $configfile
> > + echo "$configfile -------"
> > else
> > title="$configfile ------- $ncs acquisitions/releases"
> > dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> > index d75b1dc5ae53..307c4b95f325 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> > @@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
> > ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
> > if test -z "$ngps"
> > then
> > - echo $configfile
> > + echo "$configfile -------"
> > else
> > title="$configfile ------- $ngps grace periods"
> > dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> > index 26d78b7eaccf..ee1f6cae3d70 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
> > @@ -25,6 +25,7 @@
> > # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
> > +. tools/testing/selftests/rcutorture/bin/functions.sh
> > for rd in "$@"
> > do
> > firsttime=1
> > @@ -39,13 +40,24 @@ do
> > fi
> > TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
> > kvm-recheck-${TORTURE_SUITE}.sh $i
> > - configcheck.sh $i/.config $i/ConfigFragment
> > - parse-build.sh $i/Make.out $configfile
> > - parse-torture.sh $i/console.log $configfile
> > - parse-console.sh $i/console.log $configfile
> > - if test -r $i/Warnings
> > + if test -f "$i/console.log"
> > then
> > - cat $i/Warnings
> > + configcheck.sh $i/.config $i/ConfigFragment
> > + parse-build.sh $i/Make.out $configfile
> > + parse-torture.sh $i/console.log $configfile
> > + parse-console.sh $i/console.log $configfile
> > + if test -r $i/Warnings
> > + then
> > + cat $i/Warnings
> > + fi
> > + else
> > + if test -f "$i/qemu-cmd"
> > + then
> > + print_bug qemu failed
> > + else
> > + print_bug Build failed
> > + fi
> > + echo " $i"
> > fi
> > done
> > done
> > 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 7a95f86cc85a..51c34a91a375 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > @@ -106,6 +106,7 @@ then
> > fi
> > else
> > cp $builddir/Make*.out $resdir
> > + cp $builddir/.config $resdir || :
> > echo Build failed, not running KVM, see $resdir.
> > if test -f $builddir.wait
> > then
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-05-07 22:17 ` josh
@ 2014-05-10 0:51 ` Paul E. McKenney
2014-05-10 5:19 ` Josh Triplett
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-10 0:51 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 03:17:42PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:27PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The current scripting only keeps track of the git SHA-1 of the current
> > HEAD. This can cause confusion in cases where testing ran in a git
> > tree where changes had not yet been checked in. This commit therefore
> > also records the output of "git diff HEAD" to provide the information
> > needed to reconstruct the source tree that was tested.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Nit below.
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 4eed2a4f42c7..91661845fdec 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -277,6 +277,11 @@ if test -d .git
> > then
> > git status >> $resdir/$ds/testid.txt
> > git rev-parse HEAD >> $resdir/$ds/testid.txt
> > + git diff HEAD > $T/git-diff 2>&1
> > + if test -s $T/git-diff
>
> You don't need test here; you can use the return value of git diff.
Oddly enough, the "git diff" man page does not say anything about the
exit value. At least not that I could find...
Thanx, Paul
> > + then
> > + cp $T/git-diff $resdir/$ds
> > + fi
> > fi
> > ___EOF___
> > awk < $T/cfgcpu.pack \
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-05-10 0:42 ` Paul E. McKenney
@ 2014-05-10 3:46 ` Josh Triplett
2014-05-13 19:05 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-10 3:46 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:42:59PM -0700, Paul E. McKenney wrote:
> On Fri, May 09, 2014 at 05:16:57PM -0700, Josh Triplett wrote:
> > On Fri, May 09, 2014 at 05:13:46PM -0700, Paul E. McKenney wrote:
> > > On Wed, May 07, 2014 at 02:37:36PM -0700, josh@joshtriplett.org wrote:
> > > > On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > Currently, torture_kthread_stopping() prints only the name of the
> > > > > kthread that is stopping, which can be unedifying. This commit therefore
> > > > > adds "Stopping" to make things more evident.
> > > > >
> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > >
> > > > Feedback below.
> > > >
> > > > > kernel/torture.c | 5 ++++-
> > > > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/kernel/torture.c b/kernel/torture.c
> > > > > index acc9afc2f26e..f329848c3eee 100644
> > > > > --- a/kernel/torture.c
> > > > > +++ b/kernel/torture.c
> > > > > @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> > > > > */
> > > > > void torture_kthread_stopping(char *title)
> > > > > {
> > > > > + char buf[128];
> > > > > +
> > > > > + snprintf(buf, sizeof(buf), "Stopping %s", title);
> > > > > if (verbose)
> > > > > - VERBOSE_TOROUT_STRING(title);
> > > > > + VERBOSE_TOROUT_STRING(buf);
> > > >
> > > > This seems like a case where the macro has led to poorer code; rather
> > > > than using sprintf into a temporary buffer, this should just print.
> > > > Please consider fixing the output macros to allow formats, as the pr_*
> > > > macros do.
> > > >
> > > > Also, why do you need "if (verbose)" if the name of the macro has
> > > > VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
> > > > (Another good reason not to create a unique verbosity level mechanism,
> > > > and to use the kernel mechanisms instead.)
> > >
> > > Good catch, removed the redundant "if (verbose)".
> > >
> > > My attempts in the past to leverage existing in-kernel verbosity controls
> > > has caused problems such as the output appearing or not depending on
> > > the distro in question.
> >
> > That aside, though, what do you think about making the macros accept
> > format strings and arguments, in the style of pr_* and pr_fmt?
>
> If I end up needing this in a few more cases, then it would indeed be
> worth it.
I'd argue that it's worth it already: doing snprintf into a temporary
buffer seems ridiculous here, when without these macros you'd just call
pr_foo("Stopping %s\n", title);
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-05-10 0:51 ` Paul E. McKenney
@ 2014-05-10 5:19 ` Josh Triplett
2014-05-13 23:17 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-10 5:19 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:51:24PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 03:17:42PM -0700, josh@joshtriplett.org wrote:
> > On Mon, Apr 28, 2014 at 05:25:27PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > The current scripting only keeps track of the git SHA-1 of the current
> > > HEAD. This can cause confusion in cases where testing ran in a git
> > > tree where changes had not yet been checked in. This commit therefore
> > > also records the output of "git diff HEAD" to provide the information
> > > needed to reconstruct the source tree that was tested.
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > Nit below.
> > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> >
> > > ---
> > > tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > index 4eed2a4f42c7..91661845fdec 100644
> > > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > @@ -277,6 +277,11 @@ if test -d .git
> > > then
> > > git status >> $resdir/$ds/testid.txt
> > > git rev-parse HEAD >> $resdir/$ds/testid.txt
> > > + git diff HEAD > $T/git-diff 2>&1
> > > + if test -s $T/git-diff
> >
> > You don't need test here; you can use the return value of git diff.
>
> Oddly enough, the "git diff" man page does not say anything about the
> exit value. At least not that I could find...
Look for the --exit-code option of git diff.
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-05-10 0:48 ` Paul E. McKenney
@ 2014-05-10 19:34 ` Josh Triplett
2014-05-13 19:25 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Josh Triplett @ 2014-05-10 19:34 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:48:38PM -0700, Paul E. McKenney wrote:
> On Wed, May 07, 2014 at 03:11:39PM -0700, josh@joshtriplett.org wrote:
> > On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> > > completely. This commit therefore prints "BUG: Build failed" in the
> > > summary at the end of a run.
> >
> > This commit also changes a dozen other things about the output that this
> > commit message does not document. :)
>
> Well, I don't know about a dozen, but I did upgrade the commit message to
> read as follows:
>
> The reaction of kvm-recheck.sh is obscure at best, and easy to
> miss completely. This commit therefore prints "BUG: Build failed"
> in the summary at the end of a run. This commit also adds the
> line of dashes in cases where performance info is not available,
> and also avoids printing nonsense diagnostics in cases where
> some of the normal test output is not available.
What about the change to kvm-test-1-run.sh?
- Josh Triplett
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 41/45] torture: Put qemu into the background
2014-05-07 22:18 ` josh
@ 2014-05-13 17:44 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 17:44 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 03:18:58PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:29PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > Currently, qemu runs in the foreground, which prevents the script from
> > killing it in case the kernel locks up. This commit therefore places
> > qemu into the background, allowing the script to recover from lockups.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> qemu originally did run in the background before this patch series;
> please merge this into the patch that introduces the echo and thus
> breaks that.
Turned out that the conflicts weren't as bad as I had feared, so done!
Thanx, Paul
> > tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > 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 b1e85b049075..67e89f06e77f 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > @@ -157,7 +157,7 @@ then
> > echo Build-only run specified, boot/test omitted.
> > exit 0
> > fi
> > -$QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval &
> > +( $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) &
> > qemu_pid=$!
> > commandcompleted=0
> > echo Monitoring qemu job at pid $qemu_pid
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer
2014-05-10 0:14 ` Josh Triplett
2014-05-10 0:31 ` Paul E. McKenney
@ 2014-05-13 18:27 ` Paul E. McKenney
1 sibling, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 18:27 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 05:14:54PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 03:55:14PM -0700, Paul E. McKenney wrote:
> > On Fri, May 09, 2014 at 03:40:52PM -0700, Josh Triplett wrote:
> > > On Fri, May 09, 2014 at 03:30:04PM -0700, Paul E. McKenney wrote:
> > > > On Fri, May 09, 2014 at 12:32:46PM -0700, Josh Triplett wrote:
> > > > > On Fri, May 09, 2014 at 10:36:58AM -0700, Paul E. McKenney wrote:
> > > > > > On Fri, May 09, 2014 at 08:52:31AM -0700, Josh Triplett wrote:
> > > > > > > On Wed, May 07, 2014 at 04:43:13PM -0700, Paul E. McKenney wrote:
> > > > > > > > On Wed, May 07, 2014 at 02:16:49PM -0700, josh@joshtriplett.org wrote:
> > > > > > > > > On Mon, Apr 28, 2014 at 05:24:49PM -0700, Paul E. McKenney wrote:
> > > > > > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > > > > > >
> > > > > > > > > > The rcutorture output currently does not distinguish between stalls in
> > > > > > > > > > the RCU implementation and stalls in the rcu_torture_writer() kthreads.
> > > > > > > > > > This commit therefore adds some diagnostics to help distinguish between
> > > > > > > > > > these two conditions, at least for the non-SRCU implementations. (SRCU
> > > > > > > > > > does not provide evidence of update-side forward progress by design.)
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > > > > > >
> > > > > > > > > The concept makes sense, and the writer state annotations seem like a
> > > > > > > > > useful debugging mechanism, but having RCU know about RCU torture types
> > > > > > > > > seems fundamentally wrong. This mechanism accesses rcu_state, which is
> > > > > > > > > already implementation-specific, so why not just only define the
> > > > > > > > > function for the RCU implementations that support it, and then have a
> > > > > > > > > function pointer in the torture-test structure to report a stall?
> > > > > > > >
> > > > > > > > Ouch. It is worse than that! When running RCU-bh or RCU-sched,
> > > > > > > > the current code incorrectly returns the statistics for RCU.
> > > > > > > > So I do need some way for rcutorture to tell RCU which flavor
> > > > > > > > it is testing.
> > > > > > > >
> > > > > > > > One thing I could do would be to pass in a pointer to the call_rcu()
> > > > > > > > function (cur_ops->call from rcutorture's viewpoint), then scan the
> > > > > > > > rcu_state structures looking for the selected flavor (rsp->call from
> > > > > > > > tree.c's viewpoint). In the SRCU and RCU-busted cases, the flavor would
> > > > > > > > not be found, and I could then just set everything to zero.
> > > > > > > >
> > > > > > > > Does that seem reasonable, or is there a better way to do this?
> > > > > > >
> > > > > > > That search seems rather too hackish; why not just declare one
> > > > > > > stats-returning function per RCU flavor, and put the pointer to the
> > > > > > > corresponding function in the structure for each test type?
> > > > > >
> > > > > > The problem is that rcutorture doesn't know anything about the structures,
> > > > > > as those are internal to the implementation. All it knows is which
> > > > > > functions it is using. I -could- EXPORT_SYMBOL_GPL() the rcu_state
> > > > > > structures to modules (they are already non-static), then rename
> > > > > > TINY_RCU's rcu_ctrlblk to rcu_state to allow the needed type punning,
> > > > > > then do some special-case thing for SRCU, and put a pointer to whatever
> > > > > > in rcu_torture_ops, but that was feeling a bit hackish as well.
> > > > > >
> > > > > > So what did you have in mind to allow rcutorture to communicate the
> > > > > > rcuflavor to the underlying RCU implementation?
> > > > >
> > > > > Rather than EXPORT_SYMBOL_GPLing the rcu_state structures, just
> > > > > EXPORT_SYMBOL_GPL one version of rcutorture_get_gp_data per RCU flavor.
> > > > > (And hide them all behind #ifdef CONFIG_RCU_TORTURE_TEST.) Then add a
> > > > > get_gp_data field to rcu_torture_ops; if NULL, skip the stats. (Or put
> > > > > a no-op version in rcutorture.)
> > > >
> > > > But that would require me to provide these same exports from TINY_RCU,
> > > > which does not need them.
> > > >
> > > > How about exporting integers identifying the flavors of RCU to rcutorture,
> > > > which rcutorture can then pass to rcutorture_get_gp_data()? This allows
> > > > TINY_RCU to provide a trivial static inline function. TREE_RCU and
> > > > TREE_PREEMPT_RCU can keep an array of pointers to the corresponding
> > > > rcu_state structure, with NULL pointers for flavors of RCU that don't
> > > > have any data to provide.
> > > >
> > > > Would that help?
> > >
> > > Either way seems fine: a single function with an extra parameter or a
> > > unique function per flavor. But if you're going to provide the
> > > RCU-flavor integers, they should be in RCU itself and refer to RCU
> > > flavors, rather than being in rcutorture and refering to test types.
> >
> > Fair enough, will take that approach!
> >
> > I am thinking in terms of something like the following:
> >
> > RCU_FLAVOR
> > RCU_BH_FLAVOR
> > RCU_SCHED_FLAVOR
> > SRCU_FLAVOR
> > OTHER_FLAVOR
> >
> > The "OTHER_FLAVOR" would be what rcutorture uses for the "busted"
> > incorrect-on-purpose flavor of RCU, which is local to rcutorture.
> >
> > Seem reasonable, or would some other naming scheme be better?
>
> Seems reasonable to me. I'd call the last one "INVALID_RCU_FLAVOR" or
> similar.
Done!
I ended up with a switch statement rather than an array of pointers, FWIW.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG
2014-05-07 21:23 ` josh
@ 2014-05-13 19:00 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 19:00 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:23:20PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:56PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > This commit makes the torture scripts a bit more RCU-independent.
>
> You've also dropped unnecessary "export" calls; please document that in
> the commit message. With that change:
Good catch, done!
Thanx, Paul
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > index d8e68a5e4411..e838c775f709 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> > @@ -60,7 +60,7 @@ then
> > exit 2
> > fi
> > ncpus=`cpus2use.sh`
> > -make O=$builddir -j$ncpus $RCU_KMAKE_ARG > $builddir/Make.out 2>&1
> > +make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $builddir/Make.out 2>&1
> > retval=$?
> > if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
> > then
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 59945b7793d9..04ad1f980dfe 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -40,7 +40,7 @@ KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
> > PATH=${KVM}/bin:$PATH; export PATH
> > TORTURE_DEFCONFIG=defconfig
> > TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
> > -RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
> > +TORTURE_KMAKE_ARG=""
> > TORTURE_SUITE=rcu
> > resdir=""
> > configs=""
> > @@ -118,7 +118,7 @@ do
> > ;;
> > --kmake-arg)
> > checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
> > - RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
> > + TORTURE_KMAKE_ARG="$2"
> > shift
> > ;;
> > --kversion)
> > @@ -376,7 +376,7 @@ then
> > echo PATH="$PATH; export PATH"
> > echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
> > echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> > - echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG"
> > + echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> > echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> > echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
> > echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY
2014-05-07 21:24 ` josh
@ 2014-05-13 19:01 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 19:01 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:24:03PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:24:58PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > This commit makes the torture scripts a bit more RCU-independent.
>
> And removes unnecessary exports; please document that. With that
> change:
Good eyes, fixes!
Thanx, Paul
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> > ---
> > tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +-
> > tools/testing/selftests/rcutorture/bin/kvm.sh | 9 ++++++---
> > 2 files changed, 7 insertions(+), 4 deletions(-)
> >
> > 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 e82f4f201c8c..86e6ffe6df45 100755
> > --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
> > @@ -152,7 +152,7 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
> > boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
> >
> > echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
> > -if test -n "$RCU_BUILDONLY"
> > +if test -n "$TORTURE_BUILDONLY"
> > then
> > echo Build-only run specified, boot/test omitted.
> > exit 0
> > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > index 08c90cba79d2..73c586f6bdf6 100644
> > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > @@ -81,7 +81,7 @@ do
> > shift
> > ;;
> > --buildonly)
> > - RCU_BUILDONLY=1; export RCU_BUILDONLY
> > + TORTURE_BUILDONLY=1
> > ;;
> > --configs)
> > checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
> > @@ -374,7 +374,7 @@ then
> > echo KVM="$KVM; export KVM"
> > echo KVPATH="$KVPATH; export KVPATH"
> > echo PATH="$PATH; export PATH"
> > - echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
> > + echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
> > echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
> > echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
> > echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
> > @@ -402,4 +402,7 @@ echo
> > echo
> > echo " --- `date` Test summary:"
> > echo Results directory: $resdir/$ds
> > -kvm-recheck.sh $resdir/$ds
> > +if test -n "$TORTURE_BUILDONLY"
> > +then
> > + kvm-recheck.sh $resdir/$ds
> > +fi
> > --
> > 1.8.1.5
> >
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping()
2014-05-10 3:46 ` Josh Triplett
@ 2014-05-13 19:05 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 19:05 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 08:46:16PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 05:42:59PM -0700, Paul E. McKenney wrote:
> > On Fri, May 09, 2014 at 05:16:57PM -0700, Josh Triplett wrote:
> > > On Fri, May 09, 2014 at 05:13:46PM -0700, Paul E. McKenney wrote:
> > > > On Wed, May 07, 2014 at 02:37:36PM -0700, josh@joshtriplett.org wrote:
> > > > > On Mon, Apr 28, 2014 at 05:25:08PM -0700, Paul E. McKenney wrote:
> > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > >
> > > > > > Currently, torture_kthread_stopping() prints only the name of the
> > > > > > kthread that is stopping, which can be unedifying. This commit therefore
> > > > > > adds "Stopping" to make things more evident.
> > > > > >
> > > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > Feedback below.
> > > > >
> > > > > > kernel/torture.c | 5 ++++-
> > > > > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/kernel/torture.c b/kernel/torture.c
> > > > > > index acc9afc2f26e..f329848c3eee 100644
> > > > > > --- a/kernel/torture.c
> > > > > > +++ b/kernel/torture.c
> > > > > > @@ -674,8 +674,11 @@ EXPORT_SYMBOL_GPL(torture_must_stop_irq);
> > > > > > */
> > > > > > void torture_kthread_stopping(char *title)
> > > > > > {
> > > > > > + char buf[128];
> > > > > > +
> > > > > > + snprintf(buf, sizeof(buf), "Stopping %s", title);
> > > > > > if (verbose)
> > > > > > - VERBOSE_TOROUT_STRING(title);
> > > > > > + VERBOSE_TOROUT_STRING(buf);
> > > > >
> > > > > This seems like a case where the macro has led to poorer code; rather
> > > > > than using sprintf into a temporary buffer, this should just print.
> > > > > Please consider fixing the output macros to allow formats, as the pr_*
> > > > > macros do.
> > > > >
> > > > > Also, why do you need "if (verbose)" if the name of the macro has
> > > > > VERBOSE_ in it; shouldn't that mean it checks verbosity itself?
> > > > > (Another good reason not to create a unique verbosity level mechanism,
> > > > > and to use the kernel mechanisms instead.)
> > > >
> > > > Good catch, removed the redundant "if (verbose)".
> > > >
> > > > My attempts in the past to leverage existing in-kernel verbosity controls
> > > > has caused problems such as the output appearing or not depending on
> > > > the distro in question.
> > >
> > > That aside, though, what do you think about making the macros accept
> > > format strings and arguments, in the style of pr_* and pr_fmt?
> >
> > If I end up needing this in a few more cases, then it would indeed be
> > worth it.
>
> I'd argue that it's worth it already: doing snprintf into a temporary
> buffer seems ridiculous here, when without these macros you'd just call
> pr_foo("Stopping %s\n", title);
Sold, I will make this change for 3.17. Or if you would like to send along
a patch, that would be quite welcome as well. ;-)
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-05-10 19:34 ` Josh Triplett
@ 2014-05-13 19:25 ` Paul E. McKenney
2014-05-13 20:21 ` josh
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 19:25 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Sat, May 10, 2014 at 12:34:12PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 05:48:38PM -0700, Paul E. McKenney wrote:
> > On Wed, May 07, 2014 at 03:11:39PM -0700, josh@joshtriplett.org wrote:
> > > On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> > > > completely. This commit therefore prints "BUG: Build failed" in the
> > > > summary at the end of a run.
> > >
> > > This commit also changes a dozen other things about the output that this
> > > commit message does not document. :)
> >
> > Well, I don't know about a dozen, but I did upgrade the commit message to
> > read as follows:
> >
> > The reaction of kvm-recheck.sh is obscure at best, and easy to
> > miss completely. This commit therefore prints "BUG: Build failed"
> > in the summary at the end of a run. This commit also adds the
> > line of dashes in cases where performance info is not available,
> > and also avoids printing nonsense diagnostics in cases where
> > some of the normal test output is not available.
>
> What about the change to kvm-test-1-run.sh?
Right you are!
The reaction of kvm-recheck.sh is obscure at best, and easy to
miss completely. This commit therefore prints "BUG: Build failed"
in the summary at the end of a run. This commit also adds the
line of dashes in cases where performance info is not available,
and also avoids printing nonsense diagnostics in cases where
some of the normal test output is not available. In addition,
this commit saves off the .config file even when the build fails.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-05-13 19:25 ` Paul E. McKenney
@ 2014-05-13 20:21 ` josh
2014-05-13 20:33 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: josh @ 2014-05-13 20:21 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Tue, May 13, 2014 at 12:25:54PM -0700, Paul E. McKenney wrote:
> On Sat, May 10, 2014 at 12:34:12PM -0700, Josh Triplett wrote:
> > On Fri, May 09, 2014 at 05:48:38PM -0700, Paul E. McKenney wrote:
> > > On Wed, May 07, 2014 at 03:11:39PM -0700, josh@joshtriplett.org wrote:
> > > > On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> > > > > completely. This commit therefore prints "BUG: Build failed" in the
> > > > > summary at the end of a run.
> > > >
> > > > This commit also changes a dozen other things about the output that this
> > > > commit message does not document. :)
> > >
> > > Well, I don't know about a dozen, but I did upgrade the commit message to
> > > read as follows:
> > >
> > > The reaction of kvm-recheck.sh is obscure at best, and easy to
> > > miss completely. This commit therefore prints "BUG: Build failed"
> > > in the summary at the end of a run. This commit also adds the
> > > line of dashes in cases where performance info is not available,
> > > and also avoids printing nonsense diagnostics in cases where
> > > some of the normal test output is not available.
> >
> > What about the change to kvm-test-1-run.sh?
>
> Right you are!
>
> The reaction of kvm-recheck.sh is obscure at best, and easy to
> miss completely. This commit therefore prints "BUG: Build failed"
> in the summary at the end of a run. This commit also adds the
> line of dashes in cases where performance info is not available,
> and also avoids printing nonsense diagnostics in cases where
> some of the normal test output is not available. In addition,
> this commit saves off the .config file even when the build fails.
Looks good, ship it.
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures
2014-05-13 20:21 ` josh
@ 2014-05-13 20:33 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 20:33 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Tue, May 13, 2014 at 01:21:36PM -0700, josh@joshtriplett.org wrote:
> On Tue, May 13, 2014 at 12:25:54PM -0700, Paul E. McKenney wrote:
> > On Sat, May 10, 2014 at 12:34:12PM -0700, Josh Triplett wrote:
> > > On Fri, May 09, 2014 at 05:48:38PM -0700, Paul E. McKenney wrote:
> > > > On Wed, May 07, 2014 at 03:11:39PM -0700, josh@joshtriplett.org wrote:
> > > > > On Mon, Apr 28, 2014 at 05:25:20PM -0700, Paul E. McKenney wrote:
> > > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > > >
> > > > > > The reaction of kvm-recheck.sh is obscure at best, and easy to miss
> > > > > > completely. This commit therefore prints "BUG: Build failed" in the
> > > > > > summary at the end of a run.
> > > > >
> > > > > This commit also changes a dozen other things about the output that this
> > > > > commit message does not document. :)
> > > >
> > > > Well, I don't know about a dozen, but I did upgrade the commit message to
> > > > read as follows:
> > > >
> > > > The reaction of kvm-recheck.sh is obscure at best, and easy to
> > > > miss completely. This commit therefore prints "BUG: Build failed"
> > > > in the summary at the end of a run. This commit also adds the
> > > > line of dashes in cases where performance info is not available,
> > > > and also avoids printing nonsense diagnostics in cases where
> > > > some of the normal test output is not available.
> > >
> > > What about the change to kvm-test-1-run.sh?
> >
> > Right you are!
> >
> > The reaction of kvm-recheck.sh is obscure at best, and easy to
> > miss completely. This commit therefore prints "BUG: Build failed"
> > in the summary at the end of a run. This commit also adds the
> > line of dashes in cases where performance info is not available,
> > and also avoids printing nonsense diagnostics in cases where
> > some of the normal test output is not available. In addition,
> > this commit saves off the .config file even when the build fails.
>
> Looks good, ship it.
Woo-hoo!!! ;-)
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu
2014-05-07 21:59 ` josh
@ 2014-05-13 23:03 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 23:03 UTC (permalink / raw)
To: josh
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Wed, May 07, 2014 at 02:59:11PM -0700, josh@joshtriplett.org wrote:
> On Mon, Apr 28, 2014 at 05:25:09PM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > The current script does record qemu diagnostics, but the user has to
> > know where to look for them. This commit therefore puts them into the
> > Warnings file so that kvm-recheck.sh will display them. This change is
> > especially useful if you are in the habit of killing the qemu process
> > when you realize that you messed something up, but then later on wonder
> > why the process terminated early.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> A couple of issues below.
>
> > @@ -172,6 +172,14 @@ do
> > if test $kruntime -lt $seconds
> > then
> > echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
> > + grep "^(qemu) qemu:" $resdir/kvm-test-1-run.sh.out >> $resdir/Warnings 2>&1
> > + killpid="`grep "^(qemu) qemu: terminating on signal [0-9]* from pid" $resdir/kvm-test-1-run.sh.out`"
>
> You already searched for lines like this and put them in Warnings in the
> previous line, so you don't need to search the entire output. Also, you
> use grep here and sed below; you could just use sed here to directly
> obtain the PID:
>
> killpid="$(sed -n "s/^(qemu) qemu: terminating on signal [0-9]* from pid \([0-9]*\).*$/\1/p" $resdir/Warnings)"
>
> > + if test -n "$killpid"
> > + then
> > + pscmd="`echo $killpid | sed -e 's/^.*from pid/ps -ef | grep/'`"
> > + echo $pscmd >> $resdir/Warnings
> > + echo $pscmd | sh >> $resdir/Warnings 2>&1
> > + fi
>
> Grepping for a PID is a bad idea; it'll turn up anything that contains
> that PID anywhere on the line, including as a substring. Given the
> above change to obtain a numeric $killpid, you can instead pass the PID
> to ps directly:
> if test -n "$killpid"
> then
> ps -fp $killpid >> $resdir/Warnings 2>&1
> fi
All good points! What can I say? 30-year-old habits die hard. ;-)
Giving it a spin... Very nice, applied!
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-05-10 5:19 ` Josh Triplett
@ 2014-05-13 23:17 ` Paul E. McKenney
2014-05-13 23:39 ` Paul E. McKenney
0 siblings, 1 reply; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 23:17 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Fri, May 09, 2014 at 10:19:39PM -0700, Josh Triplett wrote:
> On Fri, May 09, 2014 at 05:51:24PM -0700, Paul E. McKenney wrote:
> > On Wed, May 07, 2014 at 03:17:42PM -0700, josh@joshtriplett.org wrote:
> > > On Mon, Apr 28, 2014 at 05:25:27PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > The current scripting only keeps track of the git SHA-1 of the current
> > > > HEAD. This can cause confusion in cases where testing ran in a git
> > > > tree where changes had not yet been checked in. This commit therefore
> > > > also records the output of "git diff HEAD" to provide the information
> > > > needed to reconstruct the source tree that was tested.
> > > >
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > >
> > > Nit below.
> > > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > >
> > > > ---
> > > > tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
> > > > 1 file changed, 5 insertions(+)
> > > >
> > > > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > index 4eed2a4f42c7..91661845fdec 100644
> > > > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > @@ -277,6 +277,11 @@ if test -d .git
> > > > then
> > > > git status >> $resdir/$ds/testid.txt
> > > > git rev-parse HEAD >> $resdir/$ds/testid.txt
> > > > + git diff HEAD > $T/git-diff 2>&1
> > > > + if test -s $T/git-diff
> > >
> > > You don't need test here; you can use the return value of git diff.
> >
> > Oddly enough, the "git diff" man page does not say anything about the
> > exit value. At least not that I could find...
>
> Look for the --exit-code option of git diff.
I guess I should have searched for "exit" rather than scrolling to the
bottom of the man page. Thank you for the tip! ;-)
So:
if ! git diff HEAD > $T/git-diff 2>&1
then
cp $T/git-diff $resdir/$ds
fi
The reason for dropping into /tmp and then copying if there were
diffs is that I don't want there to be an empty file if no diffs.
Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits
2014-05-13 23:17 ` Paul E. McKenney
@ 2014-05-13 23:39 ` Paul E. McKenney
0 siblings, 0 replies; 106+ messages in thread
From: Paul E. McKenney @ 2014-05-13 23:39 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, dhowells, edumazet, darren, fweisbec,
oleg, sbw
On Tue, May 13, 2014 at 04:17:16PM -0700, Paul E. McKenney wrote:
> On Fri, May 09, 2014 at 10:19:39PM -0700, Josh Triplett wrote:
> > On Fri, May 09, 2014 at 05:51:24PM -0700, Paul E. McKenney wrote:
> > > On Wed, May 07, 2014 at 03:17:42PM -0700, josh@joshtriplett.org wrote:
> > > > On Mon, Apr 28, 2014 at 05:25:27PM -0700, Paul E. McKenney wrote:
> > > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > > >
> > > > > The current scripting only keeps track of the git SHA-1 of the current
> > > > > HEAD. This can cause confusion in cases where testing ran in a git
> > > > > tree where changes had not yet been checked in. This commit therefore
> > > > > also records the output of "git diff HEAD" to provide the information
> > > > > needed to reconstruct the source tree that was tested.
> > > > >
> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > >
> > > > Nit below.
> > > > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > > >
> > > > > ---
> > > > > tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++++
> > > > > 1 file changed, 5 insertions(+)
> > > > >
> > > > > diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > > index 4eed2a4f42c7..91661845fdec 100644
> > > > > --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > > +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> > > > > @@ -277,6 +277,11 @@ if test -d .git
> > > > > then
> > > > > git status >> $resdir/$ds/testid.txt
> > > > > git rev-parse HEAD >> $resdir/$ds/testid.txt
> > > > > + git diff HEAD > $T/git-diff 2>&1
> > > > > + if test -s $T/git-diff
> > > >
> > > > You don't need test here; you can use the return value of git diff.
> > >
> > > Oddly enough, the "git diff" man page does not say anything about the
> > > exit value. At least not that I could find...
> >
> > Look for the --exit-code option of git diff.
>
> I guess I should have searched for "exit" rather than scrolling to the
> bottom of the man page. Thank you for the tip! ;-)
>
> So:
>
> if ! git diff HEAD > $T/git-diff 2>&1
Except with the --exit-code included...
Thanx, Paul
> then
> cp $T/git-diff $resdir/$ds
> fi
>
> The reason for dropping into /tmp and then copying if there were
> diffs is that I don't want there to be an empty file if no diffs.
>
> Thanx, Paul
^ permalink raw reply [flat|nested] 106+ messages in thread
end of thread, other threads:[~2014-05-13 23:40 UTC | newest]
Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-29 0:24 [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 02/45] torture: Remove obsolete builddir options Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 03/45] torture: Add batch headers "--dryrun sched" Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 04/45] torture: Make parse-rcutorture.sh less RCU-specific Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 05/45] torture: Rename RCU_INITRD to TORTURE_INITRD Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 06/45] torture: Intensify locking test Paul E. McKenney
2014-05-07 21:20 ` josh
2014-05-07 23:56 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 07/45] torture: Allow variations of "defconfig" to be specified Paul E. McKenney
2014-05-07 21:22 ` josh
2014-05-07 23:52 ` Paul E. McKenney
2014-05-08 1:54 ` Josh Triplett
2014-05-08 2:43 ` Paul E. McKenney
2014-05-08 7:47 ` Josh Triplett
2014-04-29 0:24 ` [PATCH tip/core/rcu 08/45] torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARG Paul E. McKenney
2014-05-07 21:23 ` josh
2014-05-13 19:00 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 09/45] torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGS Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 10/45] torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLY Paul E. McKenney
2014-05-07 21:24 ` josh
2014-05-13 19:01 ` Paul E. McKenney
2014-04-29 0:24 ` [PATCH tip/core/rcu 11/45] torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVE Paul E. McKenney
2014-05-07 21:26 ` josh
2014-05-07 23:59 ` Paul E. McKenney
2014-05-07 21:27 ` josh
2014-05-07 23:57 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 12/45] torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MAC Paul E. McKenney
2014-05-07 21:27 ` josh
2014-05-07 23:59 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 13/45] torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARG Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 14/45] torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMD Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 15/45] torture: Make config-fragment filtering RCU-independent Paul E. McKenney
2014-05-07 21:29 ` josh
2014-05-08 0:01 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 16/45] rcutorture: Mark function as static in kernel/rcu/torture.c Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 17/45] torture: Make "--dryrun script" output self-sufficient Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 18/45] torture: Make "--dryrun script" use same environment as normal run Paul E. McKenney
2014-05-07 21:33 ` josh
2014-05-08 0:07 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 19/45] rcutorture: Print negatives for SRCU counter wraparound Paul E. McKenney
2014-05-07 21:34 ` josh
2014-05-08 0:08 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 20/45] torture: Include "Stopping" string to torture_kthread_stopping() Paul E. McKenney
2014-05-07 21:37 ` josh
2014-05-10 0:13 ` Paul E. McKenney
2014-05-10 0:16 ` Josh Triplett
2014-05-10 0:42 ` Paul E. McKenney
2014-05-10 3:46 ` Josh Triplett
2014-05-13 19:05 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 21/45] torture: Report diagnostics from qemu Paul E. McKenney
2014-05-07 21:59 ` josh
2014-05-13 23:03 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 22/45] torture: Increase stutter-end intensity Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 23/45] torture: Permit multi-word qemu and boot arguments Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 24/45] torture: Choose bzImage location based on architecture Paul E. McKenney
2014-05-07 22:02 ` josh
2014-05-10 0:31 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 25/45] torture: Add tracing-enabled variant of TREE02 Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 26/45] torture: Dump ftrace buffer when the RCU grace period stalls Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 27/45] rcutorture: Export RCU grace-period kthread wait state to rcutorture Paul E. McKenney
2014-05-07 22:05 ` josh
2014-05-10 0:37 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 28/45] percpu: Fix raw_cpu_inc_return() Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 29/45] sched,rcu: Make cond_resched() report RCU quiescent states Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 30/45] rcutorture: Make rcu_torture_reader() use cond_resched() Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 31/45] torture: Notice if an all-zero cpumask is passed inside a critical section Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 32/45] torture: Better summary diagnostics for build failures Paul E. McKenney
2014-05-07 22:11 ` josh
2014-05-10 0:48 ` Paul E. McKenney
2014-05-10 19:34 ` Josh Triplett
2014-05-13 19:25 ` Paul E. McKenney
2014-05-13 20:21 ` josh
2014-05-13 20:33 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 33/45] rcutorture: Check for rcu_torture_fqs creation errors Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 34/45] torture: Use elapsed time to detect hangs Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 35/45] rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 36/45] rcutorture: Add tests for get_state_synchronize_rcu() Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 37/45] rcutorture: Explicitly test synchronous grace-period primitives Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 38/45] rcutorture: Add missing destroy_timer_on_stack() Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 39/45] rcutorture: Note diffs from git commits Paul E. McKenney
2014-05-07 22:17 ` josh
2014-05-10 0:51 ` Paul E. McKenney
2014-05-10 5:19 ` Josh Triplett
2014-05-13 23:17 ` Paul E. McKenney
2014-05-13 23:39 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 40/45] rcutorture: Run rcu_torture_writer at normal priority Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 41/45] torture: Put qemu into the background Paul E. McKenney
2014-05-07 22:18 ` josh
2014-05-13 17:44 ` Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 42/45] locktorture: Remove reference to nonexistent Kconfig parameter Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 43/45] torture: Check for multiple concurrent torture tests Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 44/45] torture: Remove __init from torture_init_begin/end Paul E. McKenney
2014-04-29 0:25 ` [PATCH tip/core/rcu 45/45] torture: Remove unused definition Paul E. McKenney
2014-05-07 21:16 ` [PATCH tip/core/rcu 01/45] rcutorture: Add forward-progress checking for writer josh
2014-05-07 23:43 ` Paul E. McKenney
2014-05-09 15:52 ` Josh Triplett
2014-05-09 17:36 ` Paul E. McKenney
2014-05-09 19:32 ` Josh Triplett
2014-05-09 22:30 ` Paul E. McKenney
2014-05-09 22:40 ` Josh Triplett
2014-05-09 22:55 ` Paul E. McKenney
2014-05-10 0:14 ` Josh Triplett
2014-05-10 0:31 ` Paul E. McKenney
2014-05-13 18:27 ` Paul E. McKenney
2014-05-07 22:32 ` [PATCH tip/core/rcu 0/44] Torture-test changes for 3.16 Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).