Skip to content

Commit 9692668

Browse files
committed
rcu: Make CPU-hotplug removal operations enable tick
CPU-hotplug removal operations run the multi_cpu_stop() function, which relies on the scheduler to gain control from whatever is running on the various online CPUs, including any nohz_full CPUs running long loops in kernel-mode code. Lack of the scheduler-clock interrupt on such CPUs can delay multi_cpu_stop() for several minutes and can also result in RCU CPU stall warnings. This commit therefore causes CPU-hotplug removal operations to enable the scheduler-clock interrupt on all online CPUs. [ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU->TICK_DEP_BIT_RCU fix. ] [ paulmck: Apply simplifications suggested by Frederic Weisbecker. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 366237e commit 9692668

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

kernel/rcu/tree.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,9 @@ int rcutree_dead_cpu(unsigned int cpu)
21012101
rcu_boost_kthread_setaffinity(rnp, -1);
21022102
/* Do any needed no-CB deferred wakeups from this CPU. */
21032103
do_nocb_deferred_wakeup(per_cpu_ptr(&rcu_data, cpu));
2104+
2105+
// Stop-machine done, so allow nohz_full to disable tick.
2106+
tick_dep_clear(TICK_DEP_BIT_RCU);
21042107
return 0;
21052108
}
21062109

@@ -3085,6 +3088,9 @@ int rcutree_online_cpu(unsigned int cpu)
30853088
return 0; /* Too early in boot for scheduler work. */
30863089
sync_sched_exp_online_cleanup(cpu);
30873090
rcutree_affinity_setting(cpu, -1);
3091+
3092+
// Stop-machine done, so allow nohz_full to disable tick.
3093+
tick_dep_clear(TICK_DEP_BIT_RCU);
30883094
return 0;
30893095
}
30903096

@@ -3105,6 +3111,9 @@ int rcutree_offline_cpu(unsigned int cpu)
31053111
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
31063112

31073113
rcutree_affinity_setting(cpu, cpu);
3114+
3115+
// nohz_full CPUs need the tick for stop-machine to work quickly
3116+
tick_dep_set(TICK_DEP_BIT_RCU);
31083117
return 0;
31093118
}
31103119

0 commit comments

Comments
 (0)