rcu: Move irq-disabled stall-warning checking to tree_stall.h
authorPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 14 Jan 2019 18:19:20 +0000 (10:19 -0800)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Tue, 26 Mar 2019 21:40:13 +0000 (14:40 -0700)
The rcu_iw_handler() function's sole purpose in life is to indicate
whether a stalled CPU had interrupts disabled, so it belongs in
kernel/rcu/tree_stall.h.  This commit therefore makes that move,
clarifying its header comment while in the area.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
kernel/rcu/tree.c
kernel/rcu/tree.h
kernel/rcu/tree_stall.h

index 001dd05f6e3859c27a7268061275dc1157d671a1..929531ed168c02f6f604869d7e4d5dde12d543b4 100644 (file)
@@ -1031,27 +1031,6 @@ static int dyntick_save_progress_counter(struct rcu_data *rdp)
        return 0;
 }
 
-/*
- * Handler for the irq_work request posted when a grace period has
- * gone on for too long, but not yet long enough for an RCU CPU
- * stall warning.  Set state appropriately, but just complain if
- * there is unexpected state on entry.
- */
-static void rcu_iw_handler(struct irq_work *iwp)
-{
-       struct rcu_data *rdp;
-       struct rcu_node *rnp;
-
-       rdp = container_of(iwp, struct rcu_data, rcu_iw);
-       rnp = rdp->mynode;
-       raw_spin_lock_rcu_node(rnp);
-       if (!WARN_ON_ONCE(!rdp->rcu_iw_pending)) {
-               rdp->rcu_iw_gp_seq = rnp->gp_seq;
-               rdp->rcu_iw_pending = false;
-       }
-       raw_spin_unlock_rcu_node(rnp);
-}
-
 /*
  * Return true if the specified CPU has passed through a quiescent
  * state by virtue of being in or having passed through an dynticks
index 099410dbcbe99742ce5e2c4756a4c9e4affbdf6f..f882ce3ca5a56d1e3084d0f444e6fed18952d01e 100644 (file)
@@ -443,4 +443,5 @@ static void rcu_dynticks_task_exit(void);
 
 /* Forward declarations for tree_stall.h */
 static void record_gp_stall_check_time(void);
+static void rcu_iw_handler(struct irq_work *iwp);
 static void check_cpu_stall(struct rcu_data *rdp);
index 03ed47883d8ab94a3606fabc71cd8fae6708b187..526e223e41ce2589304d50d9152304412348cdf1 100644 (file)
@@ -139,6 +139,26 @@ static void rcu_stall_kick_kthreads(void)
        }
 }
 
+/*
+ * Handler for the irq_work request posted about halfway into the RCU CPU
+ * stall timeout, and used to detect excessive irq disabling.  Set state
+ * appropriately, but just complain if there is unexpected state on entry.
+ */
+static void rcu_iw_handler(struct irq_work *iwp)
+{
+       struct rcu_data *rdp;
+       struct rcu_node *rnp;
+
+       rdp = container_of(iwp, struct rcu_data, rcu_iw);
+       rnp = rdp->mynode;
+       raw_spin_lock_rcu_node(rnp);
+       if (!WARN_ON_ONCE(!rdp->rcu_iw_pending)) {
+               rdp->rcu_iw_gp_seq = rnp->gp_seq;
+               rdp->rcu_iw_pending = false;
+       }
+       raw_spin_unlock_rcu_node(rnp);
+}
+
 //////////////////////////////////////////////////////////////////////////////
 //
 // Printing RCU CPU stall warnings