Skip to content

Commit c5bfece

Browse files
committed
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>
1 parent 0644ca5 commit c5bfece

7 files changed

Lines changed: 39 additions & 39 deletions

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,8 +1913,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
19131913
Valid arguments: on, off
19141914
Default: on
19151915

1916-
nohz_extended= [KNL,BOOT]
1917-
In kernels built with CONFIG_NO_HZ_EXTENDED=y, set
1916+
nohz_full= [KNL,BOOT]
1917+
In kernels built with CONFIG_NO_HZ_FULL=y, set
19181918
the specified list of CPUs whose tick will be stopped
19191919
whenever possible. You need to keep at least one online
19201920
CPU outside the range to maintain the timekeeping.

‎include/linux/tick.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
157157
static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
158158
# endif /* !CONFIG_NO_HZ_COMMON */
159159

160-
#ifdef CONFIG_NO_HZ_EXTENDED
161-
extern int tick_nohz_extended_cpu(int cpu);
160+
#ifdef CONFIG_NO_HZ_FULL
161+
extern int tick_nohz_full_cpu(int cpu);
162162
#else
163-
static inline int tick_nohz_extended_cpu(int cpu) { return 0; }
163+
static inline int tick_nohz_full_cpu(int cpu) { return 0; }
164164
#endif
165165

166166

‎kernel/sched/core.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,9 @@ static void wake_up_idle_cpu(int cpu)
617617
smp_send_reschedule(cpu);
618618
}
619619

620-
static bool wake_up_extended_nohz_cpu(int cpu)
620+
static bool wake_up_full_nohz_cpu(int cpu)
621621
{
622-
if (tick_nohz_extended_cpu(cpu)) {
622+
if (tick_nohz_full_cpu(cpu)) {
623623
if (cpu != smp_processor_id() ||
624624
tick_nohz_tick_stopped())
625625
smp_send_reschedule(cpu);
@@ -631,7 +631,7 @@ static bool wake_up_extended_nohz_cpu(int cpu)
631631

632632
void wake_up_nohz_cpu(int cpu)
633633
{
634-
if (!wake_up_extended_nohz_cpu(cpu))
634+
if (!wake_up_full_nohz_cpu(cpu))
635635
wake_up_idle_cpu(cpu);
636636
}
637637

‎kernel/time/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ config NO_HZ_IDLE
9696

9797
Most of the time you want to say Y here.
9898

99-
config NO_HZ_EXTENDED
99+
config NO_HZ_FULL
100100
bool "Full dynticks system (tickless single task)"
101101
# NO_HZ_COMMON dependency
102102
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
@@ -115,7 +115,7 @@ config NO_HZ_EXTENDED
115115
task on the CPU. Chances for running tickless are maximized when
116116
the task mostly runs in userspace and has few kernel activity.
117117

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
119119
desired range of dynticks CPUs.
120120

121121
This is implemented at the expense of some overhead in user <-> kernel

‎kernel/time/tick-broadcast.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
573573
bc->event_handler = tick_handle_oneshot_broadcast;
574574

575575
/* Take the do_timer update */
576-
if (!tick_nohz_extended_cpu(cpu))
576+
if (!tick_nohz_full_cpu(cpu))
577577
tick_do_timer_cpu = cpu;
578578

579579
/*

‎kernel/time/tick-common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void tick_setup_device(struct tick_device *td,
163163
* this cpu:
164164
*/
165165
if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) {
166-
if (!tick_nohz_extended_cpu(cpu))
166+
if (!tick_nohz_full_cpu(cpu))
167167
tick_do_timer_cpu = cpu;
168168
else
169169
tick_do_timer_cpu = TICK_DO_TIMER_NONE;

‎kernel/time/tick-sched.c‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void tick_sched_do_timer(ktime_t now)
113113
* jiffies_lock.
114114
*/
115115
if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)
116-
&& !tick_nohz_extended_cpu(cpu))
116+
&& !tick_nohz_full_cpu(cpu))
117117
tick_do_timer_cpu = cpu;
118118
#endif
119119

@@ -143,29 +143,29 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
143143
profile_tick(CPU_PROFILING);
144144
}
145145

146-
#ifdef CONFIG_NO_HZ_EXTENDED
147-
static cpumask_var_t nohz_extended_mask;
148-
bool have_nohz_extended_mask;
146+
#ifdef CONFIG_NO_HZ_FULL
147+
static cpumask_var_t nohz_full_mask;
148+
bool have_nohz_full_mask;
149149

150-
int tick_nohz_extended_cpu(int cpu)
150+
int tick_nohz_full_cpu(int cpu)
151151
{
152-
if (!have_nohz_extended_mask)
152+
if (!have_nohz_full_mask)
153153
return 0;
154154

155-
return cpumask_test_cpu(cpu, nohz_extended_mask);
155+
return cpumask_test_cpu(cpu, nohz_full_mask);
156156
}
157157

158158
/* Parse the boot-time nohz CPU list from the kernel parameters. */
159-
static int __init tick_nohz_extended_setup(char *str)
159+
static int __init tick_nohz_full_setup(char *str)
160160
{
161-
alloc_bootmem_cpumask_var(&nohz_extended_mask);
162-
if (cpulist_parse(str, nohz_extended_mask) < 0)
163-
pr_warning("NOHZ: Incorrect nohz_extended cpumask\n");
161+
alloc_bootmem_cpumask_var(&nohz_full_mask);
162+
if (cpulist_parse(str, nohz_full_mask) < 0)
163+
pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
164164
else
165-
have_nohz_extended_mask = true;
165+
have_nohz_full_mask = true;
166166
return 1;
167167
}
168-
__setup("nohz_extended=", tick_nohz_extended_setup);
168+
__setup("nohz_full=", tick_nohz_full_setup);
169169

170170
static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
171171
unsigned long action,
@@ -179,7 +179,7 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
179179
* If we handle the timekeeping duty for full dynticks CPUs,
180180
* we can't safely shutdown that CPU.
181181
*/
182-
if (have_nohz_extended_mask && tick_do_timer_cpu == cpu)
182+
if (have_nohz_full_mask && tick_do_timer_cpu == cpu)
183183
return -EINVAL;
184184
break;
185185
}
@@ -191,20 +191,20 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
191191
* separations: 0,2,4,6,...
192192
* This is NR_CPUS + sizeof('\0')
193193
*/
194-
static char __initdata nohz_ext_buf[NR_CPUS + 1];
194+
static char __initdata nohz_full_buf[NR_CPUS + 1];
195195

196-
static int __init init_tick_nohz_extended(void)
196+
static int __init init_tick_nohz_full(void)
197197
{
198198
cpumask_var_t online_nohz;
199199
int cpu;
200200

201-
if (!have_nohz_extended_mask)
201+
if (!have_nohz_full_mask)
202202
return 0;
203203

204204
cpu_notifier(tick_nohz_cpu_down_callback, 0);
205205

206206
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");
208208
return -ENOMEM;
209209
}
210210

@@ -215,31 +215,31 @@ static int __init init_tick_nohz_extended(void)
215215
get_online_cpus();
216216

217217
/* 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);
219219
if (cpumask_equal(online_nohz, cpu_online_mask)) {
220220
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");
222222
/*
223223
* We know the current CPU doesn't have its tick stopped.
224224
* Let's use it for the timekeeping duty.
225225
*/
226226
preempt_disable();
227227
cpu = smp_processor_id();
228-
pr_warning("NO_HZ: Clearing %d from nohz_extended range\n", cpu);
229-
cpumask_clear_cpu(cpu, nohz_extended_mask);
228+
pr_warning("NO_HZ: Clearing %d from nohz_full range\n", cpu);
229+
cpumask_clear_cpu(cpu, nohz_full_mask);
230230
preempt_enable();
231231
}
232232
put_online_cpus();
233233
free_cpumask_var(online_nohz);
234234

235-
cpulist_scnprintf(nohz_ext_buf, sizeof(nohz_ext_buf), nohz_extended_mask);
236-
pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_ext_buf);
235+
cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask);
236+
pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
237237

238238
return 0;
239239
}
240-
core_initcall(init_tick_nohz_extended);
240+
core_initcall(init_tick_nohz_full);
241241
#else
242-
#define have_nohz_extended_mask (0)
242+
#define have_nohz_full_mask (0)
243243
#endif
244244

245245
/*
@@ -589,7 +589,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
589589
return false;
590590
}
591591

592-
if (have_nohz_extended_mask) {
592+
if (have_nohz_full_mask) {
593593
/*
594594
* Keep the tick alive to guarantee timekeeping progression
595595
* if there are full dynticks CPUs around

0 commit comments

Comments
 (0)