aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-19 13:51:42 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-05-13 14:18:18 -0400
commitad0dc7f94dbf417b1c7d42e1f0b250f045b27f8f (patch)
tree7ab989cc1da5014778a7bd24ec94184104e5b517 /kernel/rcu/tree.c
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
rcutorture: Add forward-progress checking for writer
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>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0c47e300210a..3d15b5a82ae8 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -294,6 +294,39 @@ void rcutorture_record_test_transition(void)
294EXPORT_SYMBOL_GPL(rcutorture_record_test_transition); 294EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
295 295
296/* 296/*
297 * Send along grace-period-related data for rcutorture diagnostics.
298 */
299void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
300 unsigned long *gpnum, unsigned long *completed)
301{
302 struct rcu_state *rsp = NULL;
303
304 switch (test_type) {
305 case RCU_FLAVOR:
306 rsp = rcu_state;
307 break;
308 case RCU_BH_FLAVOR:
309 rsp = &rcu_bh_state;
310 break;
311 case RCU_SCHED_FLAVOR:
312 rsp = &rcu_sched_state;
313 break;
314 default:
315 break;
316 }
317 if (rsp != NULL) {
318 *flags = ACCESS_ONCE(rsp->gp_flags);
319 *gpnum = ACCESS_ONCE(rsp->gpnum);
320 *completed = ACCESS_ONCE(rsp->completed);
321 return;
322 }
323 *flags = 0;
324 *gpnum = 0;
325 *completed = 0;
326}
327EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
328
329/*
297 * Record the number of writer passes through the current rcutorture test. 330 * Record the number of writer passes through the current rcutorture test.
298 * This is also used to correlate debugfs tracing stats with the rcutorture 331 * This is also used to correlate debugfs tracing stats with the rcutorture
299 * messages. 332 * messages.