linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: core/rcu] rcu/nocb: Comment the reason behind BH disablement on batch processing
@ 2021-04-11 13:43 tip-bot2 for Frederic Weisbecker
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Frederic Weisbecker @ 2021-04-11 13:43 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Boqun Feng, Paul E. McKenney, Josh Triplett, Lai Jiangshan,
	Joel Fernandes, Neeraj Upadhyay, Frederic Weisbecker, x86,
	linux-kernel

The following commit has been merged into the core/rcu branch of tip:

Commit-ID:     5de2e5bb80aeef82f75fff76120874cdc86f935d
Gitweb:        https://git.kernel.org/tip/5de2e5bb80aeef82f75fff76120874cdc86f935d
Author:        Frederic Weisbecker <frederic@kernel.org>
AuthorDate:    Thu, 28 Jan 2021 18:12:08 +01:00
Committer:     Paul E. McKenney <paulmck@kernel.org>
CommitterDate: Mon, 08 Mar 2021 14:20:20 -08:00

rcu/nocb: Comment the reason behind BH disablement on batch processing

This commit explains why softirqs need to be disabled while invoking
callbacks, even when callback processing has been offloaded.  After
all, invoking callbacks concurrently is one thing, but concurrently
invoking the same callback is quite another.

Reported-by: Boqun Feng <boqun.feng@gmail.com>
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/rcu/tree_plugin.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index cd513ea..013142d 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2235,6 +2235,12 @@ static void nocb_cb_wait(struct rcu_data *rdp)
 	local_irq_save(flags);
 	rcu_momentary_dyntick_idle();
 	local_irq_restore(flags);
+	/*
+	 * Disable BH to provide the expected environment.  Also, when
+	 * transitioning to/from NOCB mode, a self-requeuing callback might
+	 * be invoked from softirq.  A short grace period could cause both
+	 * instances of this callback would execute concurrently.
+	 */
 	local_bh_disable();
 	rcu_do_batch(rdp);
 	local_bh_enable();

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-11 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11 13:43 [tip: core/rcu] rcu/nocb: Comment the reason behind BH disablement on batch processing tip-bot2 for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).