diff options
author | Paul E. McKenney <paulmck@linux.ibm.com> | 2018-10-03 20:25:33 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2018-12-01 15:45:40 -0500 |
commit | c51d7b5e6c94aa6b554c27bd2b0eb64ebef02334 (patch) | |
tree | 418086e10572a6dd2411f1a030129768542a167e | |
parent | 1a682754c7ed9df213069d5a0d3981f8360a32c2 (diff) |
rcutorture: Print time since GP end upon forward-progress failure
If rcutorture's forward-progress tests fail while a grace period is not
in progress, it is useful to print the time since the last grace period
ended as a way to detect failure to launch a new grace period. This
commit therefore makes this change.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
-rw-r--r-- | kernel/rcu/tree.c | 5 | ||||
-rw-r--r-- | kernel/rcu/tree.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index f91631541965..9180158756d2 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -2000,7 +2000,8 @@ static void rcu_gp_cleanup(void) | |||
2000 | 2000 | ||
2001 | WRITE_ONCE(rcu_state.gp_activity, jiffies); | 2001 | WRITE_ONCE(rcu_state.gp_activity, jiffies); |
2002 | raw_spin_lock_irq_rcu_node(rnp); | 2002 | raw_spin_lock_irq_rcu_node(rnp); |
2003 | gp_duration = jiffies - rcu_state.gp_start; | 2003 | rcu_state.gp_end = jiffies; |
2004 | gp_duration = rcu_state.gp_end - rcu_state.gp_start; | ||
2004 | if (gp_duration > rcu_state.gp_max) | 2005 | if (gp_duration > rcu_state.gp_max) |
2005 | rcu_state.gp_max = gp_duration; | 2006 | rcu_state.gp_max = gp_duration; |
2006 | 2007 | ||
@@ -2686,6 +2687,8 @@ void rcu_fwd_progress_check(unsigned long j) | |||
2686 | __func__, jiffies - rcu_state.gp_start); | 2687 | __func__, jiffies - rcu_state.gp_start); |
2687 | show_rcu_gp_kthreads(); | 2688 | show_rcu_gp_kthreads(); |
2688 | } else { | 2689 | } else { |
2690 | pr_info("%s: Last GP end %lu jiffies ago\n", | ||
2691 | __func__, jiffies - rcu_state.gp_end); | ||
2689 | preempt_disable(); | 2692 | preempt_disable(); |
2690 | rdp = this_cpu_ptr(&rcu_data); | 2693 | rdp = this_cpu_ptr(&rcu_data); |
2691 | rcu_check_gp_start_stall(rdp->mynode, rdp, j); | 2694 | rcu_check_gp_start_stall(rdp->mynode, rdp, j); |
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index a8f82b7dc5e2..d90b02b53c0e 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h | |||
@@ -328,6 +328,8 @@ struct rcu_state { | |||
328 | /* force_quiescent_state(). */ | 328 | /* force_quiescent_state(). */ |
329 | unsigned long gp_start; /* Time at which GP started, */ | 329 | unsigned long gp_start; /* Time at which GP started, */ |
330 | /* but in jiffies. */ | 330 | /* but in jiffies. */ |
331 | unsigned long gp_end; /* Time last GP ended, again */ | ||
332 | /* in jiffies. */ | ||
331 | unsigned long gp_activity; /* Time of last GP kthread */ | 333 | unsigned long gp_activity; /* Time of last GP kthread */ |
332 | /* activity in jiffies. */ | 334 | /* activity in jiffies. */ |
333 | unsigned long gp_req_activity; /* Time of last GP request */ | 335 | unsigned long gp_req_activity; /* Time of last GP request */ |