aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-19 13:56:46 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-25 16:04:50 -0400
commit09efeeee173e9f541b15157d30658cd8b23ec4f3 (patch)
tree05f9ac743eef48f6da68dd5eeb088086b7ffe6d0 /kernel/rcu/tree.c
parentaed4e046863820e6d06ebf7c079e9ad924608edf (diff)
rcu: Move callback-list warning to irq-disable region
After adopting callbacks from a newly offlined CPU, the adopting CPU checks to make sure that its callback list's count is zero only if the list has no callbacks and vice versa. Unfortunately, it does so after enabling interrupts, which means that false positives are possible due to interrupt handlers invoking call_rcu(). Although these false positives are improbable, rcutorture did make it happen once. This commit therefore moves this check to an irq-disabled region of code, thus suppressing the false positive. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index d330c17c8df4..4b03bddbca3c 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3869,14 +3869,14 @@ static void rcu_migrate_callbacks(int cpu, struct rcu_state *rsp)
3869 rcu_advance_cbs(rsp, rnp_root, rdp); /* Leverage recent GPs. */ 3869 rcu_advance_cbs(rsp, rnp_root, rdp); /* Leverage recent GPs. */
3870 rcu_advance_cbs(rsp, rnp_root, my_rdp); /* Assign GP to pending CBs. */ 3870 rcu_advance_cbs(rsp, rnp_root, my_rdp); /* Assign GP to pending CBs. */
3871 rcu_segcblist_merge(&my_rdp->cblist, &rdp->cblist); 3871 rcu_segcblist_merge(&my_rdp->cblist, &rdp->cblist);
3872 WARN_ON_ONCE(rcu_segcblist_empty(&my_rdp->cblist) !=
3873 !rcu_segcblist_n_cbs(&my_rdp->cblist));
3872 raw_spin_unlock_irqrestore_rcu_node(rnp_root, flags); 3874 raw_spin_unlock_irqrestore_rcu_node(rnp_root, flags);
3873 WARN_ONCE(rcu_segcblist_n_cbs(&rdp->cblist) != 0 || 3875 WARN_ONCE(rcu_segcblist_n_cbs(&rdp->cblist) != 0 ||
3874 !rcu_segcblist_empty(&rdp->cblist), 3876 !rcu_segcblist_empty(&rdp->cblist),
3875 "rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, 1stCB=%p\n", 3877 "rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, 1stCB=%p\n",
3876 cpu, rcu_segcblist_n_cbs(&rdp->cblist), 3878 cpu, rcu_segcblist_n_cbs(&rdp->cblist),
3877 rcu_segcblist_first_cb(&rdp->cblist)); 3879 rcu_segcblist_first_cb(&rdp->cblist));
3878 WARN_ON_ONCE(rcu_segcblist_empty(&my_rdp->cblist) !=
3879 !rcu_segcblist_n_cbs(&my_rdp->cblist));
3880} 3880}
3881 3881
3882/* 3882/*