]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rcutorture: Print time since GP end upon forward-progress failure
authorPaul E. McKenney <paulmck@linux.ibm.com>
Thu, 4 Oct 2018 00:25:33 +0000 (17:25 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Sat, 1 Dec 2018 20:45:40 +0000 (12:45 -0800)
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>
kernel/rcu/tree.c
kernel/rcu/tree.h

index f916315419651a92fa5ccd24952c30d4db430d0d..9180158756d2c2c65641c5c1700e0b2adfe25301 100644 (file)
@@ -2000,7 +2000,8 @@ static void rcu_gp_cleanup(void)
 
        WRITE_ONCE(rcu_state.gp_activity, jiffies);
        raw_spin_lock_irq_rcu_node(rnp);
-       gp_duration = jiffies - rcu_state.gp_start;
+       rcu_state.gp_end = jiffies;
+       gp_duration = rcu_state.gp_end - rcu_state.gp_start;
        if (gp_duration > rcu_state.gp_max)
                rcu_state.gp_max = gp_duration;
 
@@ -2686,6 +2687,8 @@ void rcu_fwd_progress_check(unsigned long j)
                        __func__, jiffies - rcu_state.gp_start);
                show_rcu_gp_kthreads();
        } else {
+               pr_info("%s: Last GP end %lu jiffies ago\n",
+                       __func__, jiffies - rcu_state.gp_end);
                preempt_disable();
                rdp = this_cpu_ptr(&rcu_data);
                rcu_check_gp_start_stall(rdp->mynode, rdp, j);
index a8f82b7dc5e2f6a7913aee60b3ac4c53d3ade5e8..d90b02b53c0ec4f6bdad4c66f52ee2b2cbc63018 100644 (file)
@@ -328,6 +328,8 @@ struct rcu_state {
                                                /*  force_quiescent_state(). */
        unsigned long gp_start;                 /* Time at which GP started, */
                                                /*  but in jiffies. */
+       unsigned long gp_end;                   /* Time last GP ended, again */
+                                               /*  in jiffies. */
        unsigned long gp_activity;              /* Time of last GP kthread */
                                                /*  activity in jiffies. */
        unsigned long gp_req_activity;          /* Time of last GP request */