summaryrefslogtreecommitdiff
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2018-10-02 03:40:54 +0300
committerPaul E. McKenney <paulmck@linux.ibm.com>2018-12-01 23:45:36 +0300
commite0aff97355575ac6a28a48a4217533a3953095c5 (patch)
tree4826db9f3fc2c1452fa4dd7ce0f803dc69929d1c /kernel/rcu/tree.c
parent61670adcb4a9f66ff3fa8a9e846a623d9a9e1553 (diff)
downloadlinux-e0aff97355575ac6a28a48a4217533a3953095c5.tar.xz
rcutorture: Dump grace-period diagnostics upon forward-progress OOM
This commit adds an OOM notifier during rcutorture forward-progress testing. If this notifier is invoked, it dumps out some grace-period state to help debug the forward-progress problem. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 6ec3abbe90e2..853b79a6ff10 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2658,6 +2658,26 @@ rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
}
/*
+ * Do a forward-progress check for rcutorture. This is normally invoked
+ * due to an OOM event. The argument "j" gives the time period during
+ * which rcutorture would like progress to have been made.
+ */
+void rcu_fwd_progress_check(unsigned long j)
+{
+ struct rcu_data *rdp;
+
+ if (rcu_gp_in_progress()) {
+ show_rcu_gp_kthreads();
+ } else {
+ preempt_disable();
+ rdp = this_cpu_ptr(&rcu_data);
+ rcu_check_gp_start_stall(rdp->mynode, rdp, j);
+ preempt_enable();
+ }
+}
+EXPORT_SYMBOL_GPL(rcu_fwd_progress_check);
+
+/*
* This does the RCU core processing work for the specified rcu_data
* structures. This may be called only from the CPU to whom the rdp
* belongs.