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

Commit-ID:     e3abe959fbd57aa751bc533677a35c411cee9b16
Gitweb:        
https://git.kernel.org/tip/e3abe959fbd57aa751bc533677a35c411cee9b16
Author:        Frederic Weisbecker <[email protected]>
AuthorDate:    Fri, 13 Nov 2020 13:13:26 +01:00
Committer:     Paul E. McKenney <[email protected]>
CommitterDate: Wed, 06 Jan 2021 16:24:59 -08:00

rcu/nocb: Only cond_resched() from actual offloaded batch processing

During a toggle operations, rcu_do_batch() may be invoked concurrently
by softirqs and offloaded processing for a given CPU's callbacks.
This commit therefore makes sure cond_resched() is invoked only from
the offloaded context.

Cc: Josh Triplett <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Joel Fernandes <[email protected]>
Cc: Neeraj Upadhyay <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Inspired-by: Paul E. McKenney <[email protected]>
Tested-by: Boqun Feng <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
---
 kernel/rcu/tree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 83362f6..4ef59a5 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2516,8 +2516,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
                        /* Exceeded the time limit, so leave. */
                        break;
                }
-               if (offloaded) {
-                       WARN_ON_ONCE(in_serving_softirq());
+               if (!in_serving_softirq()) {
                        local_bh_enable();
                        lockdep_assert_irqs_enabled();
                        cond_resched_tasks_rcu_qs();

Reply via email to