aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-sched.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-03-26 18:47:24 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2013-04-19 07:54:04 -0400
commitd1e43fa5f8bb25f83a86a29f11fcfb57ed4d7566 (patch)
tree9eff00255c1061248b6aef2c8341ea527610150c /kernel/time/tick-sched.c
parent0453b435df0d69dd0d8c42eb9b3015aaf0d8a032 (diff)
nohz: Ensure full dynticks CPUs are RCU nocbs
We need full dynticks CPU to also be RCU nocb so that we don't have to keep the tick to handle RCU callbacks. Make sure the range passed to nohz_full= boot parameter is a subset of rcu_nocbs= The CPUs that fail to meet this requirement will be excluded from the nohz_full range. This is checked early in boot time, before any CPU has the opportunity to stop its tick. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Christoph Lameter <cl@linux.com> Cc: Geoff Levand <geoff@infradead.org> Cc: Gilad Ben Yossef <gilad@benyossef.com> Cc: Hakan Akkan <hakanakkan@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Kevin Hilman <khilman@linaro.org> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r--kernel/time/tick-sched.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 2bac5ea2c9af..d71a5f2bd7b2 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -203,17 +203,27 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
203 */ 203 */
204static char __initdata nohz_full_buf[NR_CPUS + 1]; 204static char __initdata nohz_full_buf[NR_CPUS + 1];
205 205
206static int __init init_tick_nohz_full(void) 206void __init tick_nohz_init(void)
207{ 207{
208 if (have_nohz_full_mask) 208 int cpu;
209 cpu_notifier(tick_nohz_cpu_down_callback, 0); 209
210 if (!have_nohz_full_mask)
211 return;
212
213 cpu_notifier(tick_nohz_cpu_down_callback, 0);
214
215 /* Make sure full dynticks CPU are also RCU nocbs */
216 for_each_cpu(cpu, nohz_full_mask) {
217 if (!rcu_is_nocb_cpu(cpu)) {
218 pr_warning("NO_HZ: CPU %d is not RCU nocb: "
219 "cleared from nohz_full range", cpu);
220 cpumask_clear_cpu(cpu, nohz_full_mask);
221 }
222 }
210 223
211 cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask); 224 cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask);
212 pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf); 225 pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
213
214 return 0;
215} 226}
216core_initcall(init_tick_nohz_full);
217#else 227#else
218#define have_nohz_full_mask (0) 228#define have_nohz_full_mask (0)
219#endif 229#endif