aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/torture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-03-04 14:03:21 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-05-14 12:46:02 -0400
commitab7d45053f99f44f81a221eb5c9fbe253ee94524 (patch)
treee4d5726c3b6dc260eb1c53ad97002d56764180b5 /kernel/torture.c
parentfff35c4e9fbb0982aef6230cbf713c2492925eca (diff)
torture: Increase stutter-end intensity
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> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/torture.c')
-rw-r--r--kernel/torture.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index e5af6be2594d..bc0ee382b3c8 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -533,7 +533,11 @@ void stutter_wait(const char *title)
533 while (ACCESS_ONCE(stutter_pause_test) || 533 while (ACCESS_ONCE(stutter_pause_test) ||
534 (torture_runnable && !ACCESS_ONCE(*torture_runnable))) { 534 (torture_runnable && !ACCESS_ONCE(*torture_runnable))) {
535 if (stutter_pause_test) 535 if (stutter_pause_test)
536 schedule_timeout_interruptible(1); 536 if (ACCESS_ONCE(stutter_pause_test) == 1)
537 schedule_timeout_interruptible(1);
538 else
539 while (ACCESS_ONCE(stutter_pause_test))
540 cond_resched();
537 else 541 else
538 schedule_timeout_interruptible(round_jiffies_relative(HZ)); 542 schedule_timeout_interruptible(round_jiffies_relative(HZ));
539 torture_shutdown_absorb(title); 543 torture_shutdown_absorb(title);
@@ -550,7 +554,11 @@ static int torture_stutter(void *arg)
550 VERBOSE_TOROUT_STRING("torture_stutter task started"); 554 VERBOSE_TOROUT_STRING("torture_stutter task started");
551 do { 555 do {
552 if (!torture_must_stop()) { 556 if (!torture_must_stop()) {
553 schedule_timeout_interruptible(stutter); 557 if (stutter > 1) {
558 schedule_timeout_interruptible(stutter - 1);
559 ACCESS_ONCE(stutter_pause_test) = 2;
560 }
561 schedule_timeout_interruptible(1);
554 ACCESS_ONCE(stutter_pause_test) = 1; 562 ACCESS_ONCE(stutter_pause_test) = 1;
555 } 563 }
556 if (!torture_must_stop()) 564 if (!torture_must_stop())