aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcutorture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-07-01 14:26:57 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-09-07 19:27:20 -0400
commitbde6c3aa993066acb0d6ce32ecabe03b9d5df92d (patch)
tree09ec78a9cfa751ce36288c32c4e5112f34af8582 /kernel/rcu/rcutorture.c
parent8315f42295d2667a7f942f154b73a86fd7cb2227 (diff)
rcu: Provide cond_resched_rcu_qs() to force quiescent states in long loops
RCU-tasks requires the occasional voluntary context switch from CPU-bound in-kernel tasks. In some cases, this requires instrumenting cond_resched(). However, there is some reluctance to countenance unconditionally instrumenting cond_resched() (see http://lwn.net/Articles/603252/), so this commit creates a separate cond_resched_rcu_qs() that may be used in place of cond_resched() in locations prone to long-duration in-kernel looping. This commit currently instruments only RCU-tasks. Future possibilities include also instrumenting RCU, RCU-bh, and RCU-sched in order to reduce IPI usage. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/rcutorture.c')
-rw-r--r--kernel/rcu/rcutorture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 948a7693748e..178716713e11 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -667,7 +667,7 @@ static int rcu_torture_boost(void *arg)
667 } 667 }
668 call_rcu_time = jiffies; 668 call_rcu_time = jiffies;
669 } 669 }
670 cond_resched(); 670 cond_resched_rcu_qs();
671 stutter_wait("rcu_torture_boost"); 671 stutter_wait("rcu_torture_boost");
672 if (torture_must_stop()) 672 if (torture_must_stop())
673 goto checkwait; 673 goto checkwait;
@@ -1019,7 +1019,7 @@ rcu_torture_reader(void *arg)
1019 __this_cpu_inc(rcu_torture_batch[completed]); 1019 __this_cpu_inc(rcu_torture_batch[completed]);
1020 preempt_enable(); 1020 preempt_enable();
1021 cur_ops->readunlock(idx); 1021 cur_ops->readunlock(idx);
1022 cond_resched(); 1022 cond_resched_rcu_qs();
1023 stutter_wait("rcu_torture_reader"); 1023 stutter_wait("rcu_torture_reader");
1024 } while (!torture_must_stop()); 1024 } while (!torture_must_stop());
1025 if (irqreader && cur_ops->irq_capable) { 1025 if (irqreader && cur_ops->irq_capable) {