Skip to content

Commit

Permalink
rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers
Browse files Browse the repository at this point in the history
Deferred wakeup of rcuog kthreads upon RCU idle mode entry is going to
be handled differently whether initiated by idle, user or guest. Prepare
with pulling that control up to rcu_eqs_enter() callers.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20210131230548.32970-2-frederic@kernel.org
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Feb 17, 2021
1 parent e0ee463 commit 54b7429
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kernel/rcu/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ static noinstr void rcu_eqs_enter(bool user)
trace_rcu_dyntick(TPS("Start"), rdp->dynticks_nesting, 0, atomic_read(&rdp->dynticks));
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
rdp = this_cpu_ptr(&rcu_data);
do_nocb_deferred_wakeup(rdp);
rcu_prepare_for_idle();
rcu_preempt_deferred_qs(current);

Expand Down Expand Up @@ -672,7 +671,10 @@ static noinstr void rcu_eqs_enter(bool user)
*/
void rcu_idle_enter(void)
{
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);

lockdep_assert_irqs_disabled();
do_nocb_deferred_wakeup(rdp);
rcu_eqs_enter(false);
}
EXPORT_SYMBOL_GPL(rcu_idle_enter);
Expand All @@ -691,7 +693,14 @@ EXPORT_SYMBOL_GPL(rcu_idle_enter);
*/
noinstr void rcu_user_enter(void)
{
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);

lockdep_assert_irqs_disabled();

instrumentation_begin();
do_nocb_deferred_wakeup(rdp);
instrumentation_end();

rcu_eqs_enter(true);
}
#endif /* CONFIG_NO_HZ_FULL */
Expand Down

0 comments on commit 54b7429

Please sign in to comment.