aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-03-26 20:17:22 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2013-04-19 07:54:16 -0400
commitf98823ac758ba1aa77c6e3f8ad4ef3ad84ee0a7c (patch)
tree069ceb12d981f33d997afd214c2082a6685a2fd0 /kernel
parentd1e43fa5f8bb25f83a86a29f11fcfb57ed4d7566 (diff)
nohz: New option to default all CPUs in full dynticks range
Provide a new kernel config that defaults all CPUs to be part of the full dynticks range, except the boot one for timekeeping. This default setting is overriden by the nohz_full= boot option if passed by the user. This is helpful for those who don't need a finegrained range of full dynticks CPU and also for automated testing. Suggested-by: Ingo Molnar <mingo@kernel.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')
-rw-r--r--kernel/time/Kconfig10
-rw-r--r--kernel/time/tick-sched.c23
2 files changed, 31 insertions, 2 deletions
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 358d601a4fec..99c3f13dd478 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -128,6 +128,16 @@ config NO_HZ_FULL
128 128
129endchoice 129endchoice
130 130
131config NO_HZ_FULL_ALL
132 bool "Full dynticks system on all CPUs by default"
133 depends on NO_HZ_FULL
134 help
135 If the user doesn't pass the nohz_full boot option to
136 define the range of full dynticks CPUs, consider that all
137 CPUs in the system are full dynticks by default.
138 Note the boot CPU will still be kept outside the range to
139 handle the timekeeping duty.
140
131config NO_HZ 141config NO_HZ
132 bool "Old Idle dynticks config" 142 bool "Old Idle dynticks config"
133 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS 143 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d71a5f2bd7b2..a76e09044f9f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -203,12 +203,31 @@ 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 tick_nohz_init_all(void)
207{
208 int err = -1;
209
210#ifdef CONFIG_NO_HZ_FULL_ALL
211 if (!alloc_cpumask_var(&nohz_full_mask, GFP_KERNEL)) {
212 pr_err("NO_HZ: Can't allocate full dynticks cpumask\n");
213 return err;
214 }
215 err = 0;
216 cpumask_setall(nohz_full_mask);
217 cpumask_clear_cpu(smp_processor_id(), nohz_full_mask);
218 have_nohz_full_mask = true;
219#endif
220 return err;
221}
222
206void __init tick_nohz_init(void) 223void __init tick_nohz_init(void)
207{ 224{
208 int cpu; 225 int cpu;
209 226
210 if (!have_nohz_full_mask) 227 if (!have_nohz_full_mask) {
211 return; 228 if (tick_nohz_init_all() < 0)
229 return;
230 }
212 231
213 cpu_notifier(tick_nohz_cpu_down_callback, 0); 232 cpu_notifier(tick_nohz_cpu_down_callback, 0);
214 233