diff options
author | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-07-09 09:54:42 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-08-13 17:38:24 -0400 |
commit | 273f034065002bf9480601d66404c991b243b91e (patch) | |
tree | 544e3ca35b7efaa122064ecdfad5ee43ad006dd8 | |
parent | f7a81b12d6af42a9d09be1e5f041169f04b0b67a (diff) |
rcu/nocb: Avoid synchronous wakeup in __call_rcu_nocb_wake()
When callbacks are in full flow, the common case is waiting for a
grace period, and this grace period will normally take a few jiffies to
complete. It therefore isn't all that helpful for __call_rcu_nocb_wake()
to do a synchronous wakeup in this case. This commit therefore turns this
into a timer-based deferred wakeup of the no-CBs grace-period kthread.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
-rw-r--r-- | kernel/rcu/tree_plugin.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 25a53742ca68..4b59ef1cbc8b 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -1900,22 +1900,13 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, | |||
1900 | } else if (len > rdp->qlen_last_fqs_check + qhimark) { | 1900 | } else if (len > rdp->qlen_last_fqs_check + qhimark) { |
1901 | /* ... or if many callbacks queued. */ | 1901 | /* ... or if many callbacks queued. */ |
1902 | rdp->qlen_last_fqs_check = len; | 1902 | rdp->qlen_last_fqs_check = len; |
1903 | if (!rdp->nocb_cb_sleep && | 1903 | if (rdp->nocb_cb_sleep || |
1904 | rcu_segcblist_ready_cbs(&rdp->cblist)) { | 1904 | !rcu_segcblist_ready_cbs(&rdp->cblist)) { |
1905 | // Already going full tilt, so don't try to rewake. | ||
1906 | rcu_nocb_unlock_irqrestore(rdp, flags); | ||
1907 | } else { | ||
1908 | rcu_advance_cbs_nowake(rdp->mynode, rdp); | 1905 | rcu_advance_cbs_nowake(rdp->mynode, rdp); |
1909 | if (!irqs_disabled_flags(flags)) { | 1906 | wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_FORCE, |
1910 | wake_nocb_gp(rdp, false, flags); | 1907 | TPS("WakeOvfIsDeferred")); |
1911 | trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, | ||
1912 | TPS("WakeOvf")); | ||
1913 | } else { | ||
1914 | wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_FORCE, | ||
1915 | TPS("WakeOvfIsDeferred")); | ||
1916 | rcu_nocb_unlock_irqrestore(rdp, flags); | ||
1917 | } | ||
1918 | } | 1908 | } |
1909 | rcu_nocb_unlock_irqrestore(rdp, flags); | ||
1919 | } else { | 1910 | } else { |
1920 | trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot")); | 1911 | trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot")); |
1921 | rcu_nocb_unlock_irqrestore(rdp, flags); | 1912 | rcu_nocb_unlock_irqrestore(rdp, flags); |