Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1288041 > unrolled thread

[PATCH v2 tip/core/rcu 0/9] Torture-test updates for 4.5

Started by"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
First post2015-12-10 00:30 +0100
Last post2015-12-10 00:30 +0100
Articles 4 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 tip/core/rcu 0/9] Torture-test updates for 4.5 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 00:30 +0100
    [PATCH v2 tip/core/rcu 1/9] rcutorture: Add batch number to script printout "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 00:30 +0100
    [PATCH v2 tip/core/rcu 7/9] rcutorture: Print symbolic name for ->gp_state "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 00:30 +0100
    [PATCH v2 tip/core/rcu 9/9] torture: Place console.log files correctly from the get-go "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 00:30 +0100

#1288041 — [PATCH v2 tip/core/rcu 0/9] Torture-test updates for 4.5

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 00:30 +0100
Subject[PATCH v2 tip/core/rcu 0/9] Torture-test updates for 4.5
Message-ID<qDWlk-6vk-5@gated-at.bofh.it>
Hello!

This series contains torture-test updates:

1.	Add batch number to script printout to allow easier estimation
	of test duration.

2.	Flag non-existent RCU grace-period kthread.

3.	Dump stack when RCU's grace-period kthread stalls.

4.	Set the scripting's default test-hang "grace period" to three
	minutes, and allow this to be overridden.

5.	Remove the obsolete CONFIG_RCU_USER_QS Kconfig option from
	the rcutorture selftest documentation, courtesy of Yang Shi.

6.	Print symbolic name for rcu_torture_writer_state, saving the
	time otherwise required to manually translate from integer
	to symbol.

7.	Print symbolic name for ->gp_state, again saving the time
	otherwise required to manually translate from integer to symbol.

8.	Abbreviate console error dump, allowing the results of an
	rcutorture script run to be observed with less back-scrolling.

9.	Place console.log files correctly from the get-go, preventing
	multiple qemu instances from outputting to the same file.

Changes since v1:

o	Apply Josh Triplett review feedback.

o	Split v1's patch #2 into two patches (#2 and #3 above).

							Thanx, Paul

------------------------------------------------------------------------

 kernel/rcu/rcutorture.c                                     |   24 ++++++-
 kernel/rcu/tree.c                                           |   22 +++++-
 kernel/rcu/tree.h                                           |   12 +++
 tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh    |    9 --
 tools/testing/selftests/rcutorture/bin/kvm.sh               |   22 ++++--
 tools/testing/selftests/rcutorture/bin/parse-console.sh     |   41 ++++++++++--
 tools/testing/selftests/rcutorture/doc/TINY_RCU.txt         |    1 
 tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt |    4 -
 8 files changed, 107 insertions(+), 28 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1288043 — [PATCH v2 tip/core/rcu 1/9] rcutorture: Add batch number to script printout

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 00:30 +0100
Subject[PATCH v2 tip/core/rcu 1/9] rcutorture: Add batch number to script printout
Message-ID<qDWll-6vk-49@gated-at.bofh.it>
In reply to#1288041
Currently, the scripts print "----Start batch" at the beginning of each
batch, which does serve as a good visual delimiter between batches.
Unfortunately, if there are a lot of batches, it is hard to quickly
estimate test runtime from the output of "--dryrun sched".  This commit
therefore adds a batch number, so that the beginning-of-batch output
looks like this "----Start batch 10" for the tenth batch.

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 | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index f6483609ebc2..013c48239a66 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -307,10 +307,10 @@ awk < $T/cfgcpu.pack \
 }
 
 # Dump out the scripting required to run one test batch.
-function dump(first, pastlast)
+function dump(first, pastlast, batchnum)
 {
-	print "echo ----Start batch: `date`";
-	print "echo ----Start batch: `date` >> " rd "/log";
+	print "echo ----Start batch " batchnum ": `date`";
+	print "echo ----Start batch " batchnum ": `date` >> " rd "/log";
 	jn=1
 	for (j = first; j < pastlast; j++) {
 		builddir=KVM "/b" jn
@@ -371,25 +371,28 @@ END {
 	njobs = i;
 	nc = ncpus;
 	first = 0;
+	batchnum = 1;
 
 	# Each pass through the following loop considers one test.
 	for (i = 0; i < njobs; i++) {
 		if (ncpus == 0) {
 			# Sequential test specified, each test its own batch.
-			dump(i, i + 1);
+			dump(i, i + 1, batchnum);
 			first = i;
+			batchnum++;
 		} else if (nc < cpus[i] && i != 0) {
 			# Out of CPUs, dump out a batch.
-			dump(first, i);
+			dump(first, i, batchnum);
 			first = i;
 			nc = ncpus;
+			batchnum++;
 		}
 		# Account for the CPUs needed by the current test.
 		nc -= cpus[i];
 	}
 	# Dump the last batch.
 	if (ncpus != 0)
-		dump(first, i);
+		dump(first, i, batchnum);
 }' >> $T/script
 
 cat << ___EOF___ >> $T/script
-- 
2.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288044 — [PATCH v2 tip/core/rcu 7/9] rcutorture: Print symbolic name for ->gp_state

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 00:30 +0100
Subject[PATCH v2 tip/core/rcu 7/9] rcutorture: Print symbolic name for ->gp_state
Message-ID<qDWll-6vk-51@gated-at.bofh.it>
In reply to#1288041
Currently, ->gp_state is printed as an integer, which slows debugging.
This commit therefore prints a symbolic name in addition to the integer.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ paulmck: Updated to fix relational operator called out by Dan Carpenter. ]
[ paulmck: More "const", as suggested by Josh Triplett. ]
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
 kernel/rcu/tree.c | 15 +++++++++++++--
 kernel/rcu/tree.h | 12 ++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 7b78c88e19a3..316354109734 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1187,6 +1187,16 @@ static void record_gp_stall_check_time(struct rcu_state *rsp)
 }
 
 /*
+ * Convert a ->gp_state value to a character string.
+ */
+static const char *gp_state_getname(short gs)
+{
+	if (gs < 0 || gs >= ARRAY_SIZE(gp_state_names))
+		return "???";
+	return gp_state_names[gs];
+}
+
+/*
  * Complain about starvation of grace-period kthread.
  */
 static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp)
@@ -1197,10 +1207,11 @@ static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp)
 	j = jiffies;
 	gpa = READ_ONCE(rsp->gp_activity);
 	if (j - gpa > 2 * HZ) {
-		pr_err("%s kthread starved for %ld jiffies! g%lu c%lu f%#x s%d ->state=%#lx\n",
+		pr_err("%s kthread starved for %ld jiffies! g%lu c%lu f%#x %s(%d) ->state=%#lx\n",
 		       rsp->name, j - gpa,
 		       rsp->gpnum, rsp->completed,
-		       rsp->gp_flags, rsp->gp_state,
+		       rsp->gp_flags,
+		       gp_state_getname(rsp->gp_state), rsp->gp_state,
 		       rsp->gp_kthread ? rsp->gp_kthread->state : ~0);
 		if (rsp->gp_kthread)
 			sched_show_task(rsp->gp_kthread);
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index f32bebb6bc90..a3fb6fe94127 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -545,6 +545,18 @@ struct rcu_state {
 #define RCU_GP_CLEANUP   5	/* Grace-period cleanup started. */
 #define RCU_GP_CLEANED   6	/* Grace-period cleanup complete. */
 
+#ifndef RCU_TREE_NONCORE
+static const char * const gp_state_names[] = {
+	"RCU_GP_IDLE",
+	"RCU_GP_WAIT_GPS",
+	"RCU_GP_DONE_GPS",
+	"RCU_GP_WAIT_FQS",
+	"RCU_GP_DOING_FQS",
+	"RCU_GP_CLEANUP",
+	"RCU_GP_CLEANED",
+};
+#endif /* #ifndef RCU_TREE_NONCORE */
+
 extern struct list_head rcu_struct_flavors;
 
 /* Sequence through rcu_state structures for each RCU flavor. */
-- 
2.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288052 — [PATCH v2 tip/core/rcu 9/9] torture: Place console.log files correctly from the get-go

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 00:30 +0100
Subject[PATCH v2 tip/core/rcu 9/9] torture: Place console.log files correctly from the get-go
Message-ID<qDWlm-6vk-67@gated-at.bofh.it>
In reply to#1288041
Currently, the console output files ("console.log") are placed in the
build directory initially, then copied to the results directory.
One problem with this is if a qemu refuses to die in a timely fashion
after a kernel hang, it will continue to write after the next qemu
starts up, resulting in confusing output from the old instance of
qemu.  This commit prevents such confusion by placing the console.log
files into the results directory to begin with, so that a given instance
of qemu is always writing only to its own console.log file.

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 | 5 ++---
 1 file changed, 2 insertions(+), 3 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 d39273dae464..0f80eefb0bfd 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -150,7 +150,7 @@ fi
 qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
 
 # Generate architecture-specific and interaction-specific qemu arguments
-qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$builddir/console.log"`"
+qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$resdir/console.log"`"
 
 # Generate qemu -append arguments
 qemu_append="`identify_qemu_append "$QEMU"`"
@@ -166,7 +166,7 @@ then
 	touch $resdir/buildonly
 	exit 0
 fi
-echo "NOTE: $QEMU either did not run or was interactive" > $builddir/console.log
+echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
 echo $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
 ( $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) &
 qemu_pid=$!
@@ -222,6 +222,5 @@ then
 	done
 fi
 
-cp $builddir/console.log $resdir
 parse-torture.sh $resdir/console.log $title
 parse-console.sh $resdir/console.log $title
-- 
2.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web