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


Groups > linux.kernel > #1467884 > unrolled thread

[PATCH tip/core/rcu 0/5] Torture-test updates for 4.9

Started by"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
First post2016-08-22 20:30 +0200
Last post2016-08-22 22:00 +0200
Articles 4 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH tip/core/rcu 0/5] Torture-test updates for 4.9 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 20:30 +0200
    [PATCH tip/core/rcu 4/5] rcuperf: Insert space between flag and message consistently "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 21:20 +0200
    [PATCH tip/core/rcu 3/5] rcutorture: Print out barrier error as document says "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 21:40 +0200
    [PATCH tip/core/rcu 1/5] torture: Convert torture_shutdown() to hrtimer "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 22:00 +0200

#1467884 — [PATCH tip/core/rcu 0/5] Torture-test updates for 4.9

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-08-22 20:30 +0200
Subject[PATCH tip/core/rcu 0/5] Torture-test updates for 4.9
Message-ID<s90Aa-iZ-41@gated-at.bofh.it>
Hello!

This series provides some torture-test updates:

1.	Convert torture_shutdown() to hrtimer to avoid new-age
	timer-wheel inaccuracies.

2.	Add task state to writer-task stall printk()s.

3.	Print out barrier error as documentation says, courtesy of
	SeongJae Park.

4.	Insert space between flag and message consistently in rcuperf,
	courtesy of SeongJae Park.

5.	Insert space between flag and message consistently in rcutorture
	and locktorture, courtesy of SeongJae Park.

								Thanx, Paul

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

 include/linux/torture.h |    2 +-
 kernel/rcu/rcuperf.c    |    7 +++----
 kernel/rcu/rcutorture.c |   10 +++++++---
 kernel/torture.c        |   27 +++++++++++++--------------
 4 files changed, 24 insertions(+), 22 deletions(-)

[toc] | [next] | [standalone]


#1467970 — [PATCH tip/core/rcu 4/5] rcuperf: Insert space between flag and message consistently

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-08-22 21:20 +0200
Subject[PATCH tip/core/rcu 4/5] rcuperf: Insert space between flag and message consistently
Message-ID<s92Vk-1VN-19@gated-at.bofh.it>
In reply to#1467884
From: SeongJae Park <sj38.park@gmail.com>

Few output messages of rcuperf has no space between flag and start of
message while every other messages keeps a space consistently.  It makes
output messages to be inconsistent and weird especially when it be read
by dmesg with color option enabled.  This commit fixes the problem by
modifying a pr_alert() call and PERFOUT_STRING() macro function.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/rcuperf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index d38ab08a3fe7..123ccbd22449 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -52,7 +52,7 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.vnet.ibm.com>");
 
 #define PERF_FLAG "-perf:"
 #define PERFOUT_STRING(s) \
-	pr_alert("%s" PERF_FLAG s "\n", perf_type)
+	pr_alert("%s" PERF_FLAG " %s\n", perf_type, s)
 #define VERBOSE_PERFOUT_STRING(s) \
 	do { if (verbose) pr_alert("%s" PERF_FLAG " %s\n", perf_type, s); } while (0)
 #define VERBOSE_PERFOUT_ERRSTRING(s) \
@@ -400,9 +400,8 @@ rcu_perf_writer(void *arg)
 			sp.sched_priority = 0;
 			sched_setscheduler_nocheck(current,
 						   SCHED_NORMAL, &sp);
-			pr_alert("%s" PERF_FLAG
-				 "rcu_perf_writer %ld has %d measurements\n",
-				 perf_type, me, MIN_MEAS);
+			pr_alert("%s%s rcu_perf_writer %ld has %d measurements\n",
+				 perf_type, PERF_FLAG, me, MIN_MEAS);
 			if (atomic_inc_return(&n_rcu_perf_writer_finished) >=
 			    nrealwriters) {
 				schedule_timeout_interruptible(10);
-- 
2.5.2

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


#1467996 — [PATCH tip/core/rcu 3/5] rcutorture: Print out barrier error as document says

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-08-22 21:40 +0200
Subject[PATCH tip/core/rcu 3/5] rcutorture: Print out barrier error as document says
Message-ID<s93eG-26x-13@gated-at.bofh.it>
In reply to#1467884
From: SeongJae Park <sj38.park@gmail.com>

Test for rcu_barrier() has introduced by commit fae4b54f28f0 ("rcu:
Introduce rcutorture testing for rcu_barrier()").  Updated document says
that `rtbe` field of output indicates failure of the test.  However, the
code has not updated as so.  This commit updates the code to print out
the field as document says.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
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 f0f32f888ec5..ac29017623e5 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1259,8 +1259,9 @@ rcu_torture_stats_print(void)
 		atomic_read(&n_rcu_torture_alloc),
 		atomic_read(&n_rcu_torture_alloc_fail),
 		atomic_read(&n_rcu_torture_free));
-	pr_cont("rtmbe: %d rtbke: %ld rtbre: %ld ",
+	pr_cont("rtmbe: %d rtbe: %ld rtbke: %ld rtbre: %ld ",
 		atomic_read(&n_rcu_torture_mberror),
+		n_rcu_torture_barrier_error,
 		n_rcu_torture_boost_ktrerror,
 		n_rcu_torture_boost_rterror);
 	pr_cont("rtbf: %ld rtb: %ld nt: %ld ",
-- 
2.5.2

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


#1468016 — [PATCH tip/core/rcu 1/5] torture: Convert torture_shutdown() to hrtimer

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-08-22 22:00 +0200
Subject[PATCH tip/core/rcu 1/5] torture: Convert torture_shutdown() to hrtimer
Message-ID<s93y2-2dU-53@gated-at.bofh.it>
In reply to#1467884
Upcoming changes to the timer wheel introduce significant inaccuracy
and possibly also an ultimate limit on timeout duration.  This is
a problem for the current implementation of torture_shutdown() because
(1) shutdown times are user-specified, and can therefore be quite
long, and (2) the torture scripting will kill a test instance that
runs for more than a few minutes longer than scheduled.  This commit
therefore converts the torture_shutdown() timed waits to an hrtimer.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/torture.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/kernel/torture.c b/kernel/torture.c
index 75961b3decfe..0d887eb62856 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -43,6 +43,7 @@
 #include <linux/stat.h>
 #include <linux/slab.h>
 #include <linux/trace_clock.h>
+#include <linux/ktime.h>
 #include <asm/byteorder.h>
 #include <linux/torture.h>
 
@@ -446,9 +447,8 @@ EXPORT_SYMBOL_GPL(torture_shuffle_cleanup);
  * Variables for auto-shutdown.  This allows "lights out" torture runs
  * to be fully scripted.
  */
-static int shutdown_secs;		/* desired test duration in seconds. */
 static struct task_struct *shutdown_task;
-static unsigned long shutdown_time;	/* jiffies to system shutdown. */
+static ktime_t shutdown_time;		/* time to system shutdown. */
 static void (*torture_shutdown_hook)(void);
 
 /*
@@ -471,20 +471,20 @@ EXPORT_SYMBOL_GPL(torture_shutdown_absorb);
  */
 static int torture_shutdown(void *arg)
 {
-	long delta;
-	unsigned long jiffies_snap;
+	ktime_t ktime_snap;
 
 	VERBOSE_TOROUT_STRING("torture_shutdown task started");
-	jiffies_snap = jiffies;
-	while (ULONG_CMP_LT(jiffies_snap, shutdown_time) &&
+	ktime_snap = ktime_get();
+	while (ktime_before(ktime_snap, shutdown_time) &&
 	       !torture_must_stop()) {
-		delta = shutdown_time - jiffies_snap;
 		if (verbose)
 			pr_alert("%s" TORTURE_FLAG
-				 "torture_shutdown task: %lu jiffies remaining\n",
-				 torture_type, delta);
-		schedule_timeout_interruptible(delta);
-		jiffies_snap = jiffies;
+				 "torture_shutdown task: %llu ms remaining\n",
+				 torture_type,
+				 ktime_ms_delta(shutdown_time, ktime_snap));
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_hrtimeout(&shutdown_time, HRTIMER_MODE_ABS);
+		ktime_snap = ktime_get();
 	}
 	if (torture_must_stop()) {
 		torture_kthread_stopping("torture_shutdown");
@@ -511,10 +511,9 @@ int torture_shutdown_init(int ssecs, void (*cleanup)(void))
 {
 	int ret = 0;
 
-	shutdown_secs = ssecs;
 	torture_shutdown_hook = cleanup;
-	if (shutdown_secs > 0) {
-		shutdown_time = jiffies + shutdown_secs * HZ;
+	if (ssecs > 0) {
+		shutdown_time = ktime_add(ktime_get(), ktime_set(ssecs, 0));
 		ret = torture_create_kthread(torture_shutdown, NULL,
 					     shutdown_task);
 	}
-- 
2.5.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web