aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-04-12 10:45:34 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2013-04-15 13:58:17 -0400
commitc5bfece2d6129131b4ade985e63bc35ddf5868d4 (patch)
tree65b7f1c3e9ad5dd45375ccdc1dab187ba968cf59 /kernel/time
parent0644ca5c774f1a7033bfc83c7ed0660f74f28b56 (diff)
nohz: Switch from "extended nohz" to "full nohz" based naming
"Extended nohz" was used as a naming base for the full dynticks API and Kconfig symbols. It reflects the fact the system tries to stop the tick in more places than just idle. But that "extended" name is a bit opaque and vague. Rename it to "full" makes it clearer what the system tries to do under this config: try to shutdown the tick anytime it can. The various constraints that prevent that to happen shouldn't be considered as fundamental properties of this feature but rather technical issues that may be solved in the future. Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> 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')
-rw-r--r--kernel/time/Kconfig4
-rw-r--r--kernel/time/tick-broadcast.c2
-rw-r--r--kernel/time/tick-common.c2
-rw-r--r--kernel/time/tick-sched.c54
4 files changed, 31 insertions, 31 deletions
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index cbe64be17d1f..4a17b5069466 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -96,7 +96,7 @@ config NO_HZ_IDLE
96 96
97 Most of the time you want to say Y here. 97 Most of the time you want to say Y here.
98 98
99config NO_HZ_EXTENDED 99config NO_HZ_FULL
100 bool "Full dynticks system (tickless single task)" 100 bool "Full dynticks system (tickless single task)"
101 # NO_HZ_COMMON dependency 101 # NO_HZ_COMMON dependency
102 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS 102 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
@@ -115,7 +115,7 @@ config NO_HZ_EXTENDED
115 task on the CPU. Chances for running tickless are maximized when 115 task on the CPU. Chances for running tickless are maximized when
116 the task mostly runs in userspace and has few kernel activity. 116 the task mostly runs in userspace and has few kernel activity.
117 117
118 You need to fill up the nohz_extended boot parameter with the 118 You need to fill up the nohz_full boot parameter with the
119 desired range of dynticks CPUs. 119 desired range of dynticks CPUs.
120 120
121 This is implemented at the expense of some overhead in user <-> kernel 121 This is implemented at the expense of some overhead in user <-> kernel
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 8a6875cc1879..a3a3123f6272 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -573,7 +573,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
573 bc->event_handler = tick_handle_oneshot_broadcast; 573 bc->event_handler = tick_handle_oneshot_broadcast;
574 574
575 /* Take the do_timer update */ 575 /* Take the do_timer update */
576 if (!tick_nohz_extended_cpu(cpu)) 576 if (!tick_nohz_full_cpu(cpu))
577 tick_do_timer_cpu = cpu; 577 tick_do_timer_cpu = cpu;
578 578
579 /* 579 /*
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index b7dc0cbdb59b..83f2bd967161 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -163,7 +163,7 @@ static void tick_setup_device(struct tick_device *td,
163 * this cpu: 163 * this cpu:
164 */ 164 */
165 if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) { 165 if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) {
166 if (!tick_nohz_extended_cpu(cpu)) 166 if (!tick_nohz_full_cpu(cpu))
167 tick_do_timer_cpu = cpu; 167 tick_do_timer_cpu = cpu;
168 else 168 else
169 tick_do_timer_cpu = TICK_DO_TIMER_NONE; 169 tick_do_timer_cpu = TICK_DO_TIMER_NONE;
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index e057d338daa4..369b5769fc97 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -113,7 +113,7 @@ static void tick_sched_do_timer(ktime_t now)
113 * jiffies_lock. 113 * jiffies_lock.
114 */ 114 */
115 if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE) 115 if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)
116 && !tick_nohz_extended_cpu(cpu)) 116 && !tick_nohz_full_cpu(cpu))
117 tick_do_timer_cpu = cpu; 117 tick_do_timer_cpu = cpu;
118#endif 118#endif
119 119
@@ -143,29 +143,29 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
143 profile_tick(CPU_PROFILING); 143 profile_tick(CPU_PROFILING);
144} 144}
145 145
146#ifdef CONFIG_NO_HZ_EXTENDED 146#ifdef CONFIG_NO_HZ_FULL
147static cpumask_var_t nohz_extended_mask; 147static cpumask_var_t nohz_full_mask;
148bool have_nohz_extended_mask; 148bool have_nohz_full_mask;
149 149
150int tick_nohz_extended_cpu(int cpu) 150int tick_nohz_full_cpu(int cpu)
151{ 151{
152 if (!have_nohz_extended_mask) 152 if (!have_nohz_full_mask)
153 return 0; 153 return 0;
154 154
155 return cpumask_test_cpu(cpu, nohz_extended_mask); 155 return cpumask_test_cpu(cpu, nohz_full_mask);
156} 156}
157 157
158/* Parse the boot-time nohz CPU list from the kernel parameters. */ 158/* Parse the boot-time nohz CPU list from the kernel parameters. */
159static int __init tick_nohz_extended_setup(char *str) 159static int __init tick_nohz_full_setup(char *str)
160{ 160{
161 alloc_bootmem_cpumask_var(&nohz_extended_mask); 161 alloc_bootmem_cpumask_var(&nohz_full_mask);
162 if (cpulist_parse(str, nohz_extended_mask) < 0) 162 if (cpulist_parse(str, nohz_full_mask) < 0)
163 pr_warning("NOHZ: Incorrect nohz_extended cpumask\n"); 163 pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
164 else 164 else
165 have_nohz_extended_mask = true; 165 have_nohz_full_mask = true;
166 return 1; 166 return 1;
167} 167}
168__setup("nohz_extended=", tick_nohz_extended_setup); 168__setup("nohz_full=", tick_nohz_full_setup);
169 169
170static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb, 170static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
171 unsigned long action, 171 unsigned long action,
@@ -179,7 +179,7 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
179 * If we handle the timekeeping duty for full dynticks CPUs, 179 * If we handle the timekeeping duty for full dynticks CPUs,
180 * we can't safely shutdown that CPU. 180 * we can't safely shutdown that CPU.
181 */ 181 */
182 if (have_nohz_extended_mask && tick_do_timer_cpu == cpu) 182 if (have_nohz_full_mask && tick_do_timer_cpu == cpu)
183 return -EINVAL; 183 return -EINVAL;
184 break; 184 break;
185 } 185 }
@@ -191,20 +191,20 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
191 * separations: 0,2,4,6,... 191 * separations: 0,2,4,6,...
192 * This is NR_CPUS + sizeof('\0') 192 * This is NR_CPUS + sizeof('\0')
193 */ 193 */
194static char __initdata nohz_ext_buf[NR_CPUS + 1]; 194static char __initdata nohz_full_buf[NR_CPUS + 1];
195 195
196static int __init init_tick_nohz_extended(void) 196static int __init init_tick_nohz_full(void)
197{ 197{
198 cpumask_var_t online_nohz; 198 cpumask_var_t online_nohz;
199 int cpu; 199 int cpu;
200 200
201 if (!have_nohz_extended_mask) 201 if (!have_nohz_full_mask)
202 return 0; 202 return 0;
203 203
204 cpu_notifier(tick_nohz_cpu_down_callback, 0); 204 cpu_notifier(tick_nohz_cpu_down_callback, 0);
205 205
206 if (!zalloc_cpumask_var(&online_nohz, GFP_KERNEL)) { 206 if (!zalloc_cpumask_var(&online_nohz, GFP_KERNEL)) {
207 pr_warning("NO_HZ: Not enough memory to check extended nohz mask\n"); 207 pr_warning("NO_HZ: Not enough memory to check full nohz mask\n");
208 return -ENOMEM; 208 return -ENOMEM;
209 } 209 }
210 210
@@ -215,31 +215,31 @@ static int __init init_tick_nohz_extended(void)
215 get_online_cpus(); 215 get_online_cpus();
216 216
217 /* Ensure we keep a CPU outside the dynticks range for timekeeping */ 217 /* Ensure we keep a CPU outside the dynticks range for timekeeping */
218 cpumask_and(online_nohz, cpu_online_mask, nohz_extended_mask); 218 cpumask_and(online_nohz, cpu_online_mask, nohz_full_mask);
219 if (cpumask_equal(online_nohz, cpu_online_mask)) { 219 if (cpumask_equal(online_nohz, cpu_online_mask)) {
220 pr_warning("NO_HZ: Must keep at least one online CPU " 220 pr_warning("NO_HZ: Must keep at least one online CPU "
221 "out of nohz_extended range\n"); 221 "out of nohz_full range\n");
222 /* 222 /*
223 * We know the current CPU doesn't have its tick stopped. 223 * We know the current CPU doesn't have its tick stopped.
224 * Let's use it for the timekeeping duty. 224 * Let's use it for the timekeeping duty.
225 */ 225 */
226 preempt_disable(); 226 preempt_disable();
227 cpu = smp_processor_id(); 227 cpu = smp_processor_id();
228 pr_warning("NO_HZ: Clearing %d from nohz_extended range\n", cpu); 228 pr_warning("NO_HZ: Clearing %d from nohz_full range\n", cpu);
229 cpumask_clear_cpu(cpu, nohz_extended_mask); 229 cpumask_clear_cpu(cpu, nohz_full_mask);
230 preempt_enable(); 230 preempt_enable();
231 } 231 }
232 put_online_cpus(); 232 put_online_cpus();
233 free_cpumask_var(online_nohz); 233 free_cpumask_var(online_nohz);
234 234
235 cpulist_scnprintf(nohz_ext_buf, sizeof(nohz_ext_buf), nohz_extended_mask); 235 cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask);
236 pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_ext_buf); 236 pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
237 237
238 return 0; 238 return 0;
239} 239}
240core_initcall(init_tick_nohz_extended); 240core_initcall(init_tick_nohz_full);
241#else 241#else
242#define have_nohz_extended_mask (0) 242#define have_nohz_full_mask (0)
243#endif 243#endif
244 244
245/* 245/*
@@ -589,7 +589,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
589 return false; 589 return false;
590 } 590 }
591 591
592 if (have_nohz_extended_mask) { 592 if (have_nohz_full_mask) {
593 /* 593 /*
594 * Keep the tick alive to guarantee timekeeping progression 594 * Keep the tick alive to guarantee timekeeping progression
595 * if there are full dynticks CPUs around 595 * if there are full dynticks CPUs around