Skip to content

Commit 73867dc

Browse files
committed
nohz: Rename a few state variables
Rename the full dynticks's cpumask and cpumask state variables to some more exportable names. These will be used later from global headers to optimize the main full dynticks APIs in conjunction with static keys. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Kevin Hilman <khilman@linaro.org>
1 parent af2350b commit 73867dc

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

‎kernel/time/tick-sched.c‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
149149
}
150150

151151
#ifdef CONFIG_NO_HZ_FULL
152-
static cpumask_var_t nohz_full_mask;
153-
bool have_nohz_full_mask;
152+
static cpumask_var_t tick_nohz_full_mask;
153+
bool tick_nohz_full_running;
154154

155155
static bool can_stop_full_tick(void)
156156
{
@@ -183,7 +183,7 @@ static bool can_stop_full_tick(void)
183183
* Don't allow the user to think they can get
184184
* full NO_HZ with this machine.
185185
*/
186-
WARN_ONCE(have_nohz_full_mask,
186+
WARN_ONCE(tick_nohz_full_running,
187187
"NO_HZ FULL will not work with unstable sched clock");
188188
return false;
189189
}
@@ -240,11 +240,11 @@ static void nohz_full_kick_ipi(void *info)
240240
*/
241241
void tick_nohz_full_kick_all(void)
242242
{
243-
if (!have_nohz_full_mask)
243+
if (!tick_nohz_full_running)
244244
return;
245245

246246
preempt_disable();
247-
smp_call_function_many(nohz_full_mask,
247+
smp_call_function_many(tick_nohz_full_mask,
248248
nohz_full_kick_ipi, NULL, false);
249249
preempt_enable();
250250
}
@@ -272,29 +272,29 @@ void tick_nohz_task_switch(struct task_struct *tsk)
272272

273273
int tick_nohz_full_cpu(int cpu)
274274
{
275-
if (!have_nohz_full_mask)
275+
if (!tick_nohz_full_running)
276276
return 0;
277277

278-
return cpumask_test_cpu(cpu, nohz_full_mask);
278+
return cpumask_test_cpu(cpu, tick_nohz_full_mask);
279279
}
280280

281281
/* Parse the boot-time nohz CPU list from the kernel parameters. */
282282
static int __init tick_nohz_full_setup(char *str)
283283
{
284284
int cpu;
285285

286-
alloc_bootmem_cpumask_var(&nohz_full_mask);
287-
if (cpulist_parse(str, nohz_full_mask) < 0) {
286+
alloc_bootmem_cpumask_var(&tick_nohz_full_mask);
287+
if (cpulist_parse(str, tick_nohz_full_mask) < 0) {
288288
pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
289289
return 1;
290290
}
291291

292292
cpu = smp_processor_id();
293-
if (cpumask_test_cpu(cpu, nohz_full_mask)) {
293+
if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
294294
pr_warning("NO_HZ: Clearing %d from nohz_full range for timekeeping\n", cpu);
295-
cpumask_clear_cpu(cpu, nohz_full_mask);
295+
cpumask_clear_cpu(cpu, tick_nohz_full_mask);
296296
}
297-
have_nohz_full_mask = true;
297+
tick_nohz_full_running = true;
298298

299299
return 1;
300300
}
@@ -312,7 +312,7 @@ static int tick_nohz_cpu_down_callback(struct notifier_block *nfb,
312312
* If we handle the timekeeping duty for full dynticks CPUs,
313313
* we can't safely shutdown that CPU.
314314
*/
315-
if (have_nohz_full_mask && tick_do_timer_cpu == cpu)
315+
if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
316316
return NOTIFY_BAD;
317317
break;
318318
}
@@ -331,14 +331,14 @@ static int tick_nohz_init_all(void)
331331
int err = -1;
332332

333333
#ifdef CONFIG_NO_HZ_FULL_ALL
334-
if (!alloc_cpumask_var(&nohz_full_mask, GFP_KERNEL)) {
334+
if (!alloc_cpumask_var(&tick_nohz_full_mask, GFP_KERNEL)) {
335335
pr_err("NO_HZ: Can't allocate full dynticks cpumask\n");
336336
return err;
337337
}
338338
err = 0;
339-
cpumask_setall(nohz_full_mask);
340-
cpumask_clear_cpu(smp_processor_id(), nohz_full_mask);
341-
have_nohz_full_mask = true;
339+
cpumask_setall(tick_nohz_full_mask);
340+
cpumask_clear_cpu(smp_processor_id(), tick_nohz_full_mask);
341+
tick_nohz_full_running = true;
342342
#endif
343343
return err;
344344
}
@@ -347,20 +347,20 @@ void __init tick_nohz_init(void)
347347
{
348348
int cpu;
349349

350-
if (!have_nohz_full_mask) {
350+
if (!tick_nohz_full_running) {
351351
if (tick_nohz_init_all() < 0)
352352
return;
353353
}
354354

355-
for_each_cpu(cpu, nohz_full_mask)
355+
for_each_cpu(cpu, tick_nohz_full_mask)
356356
context_tracking_cpu_set(cpu);
357357

358358
cpu_notifier(tick_nohz_cpu_down_callback, 0);
359-
cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask);
359+
cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), tick_nohz_full_mask);
360360
pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
361361
}
362362
#else
363-
#define have_nohz_full_mask (0)
363+
#define tick_nohz_full_running (0)
364364
#endif
365365

366366
/*
@@ -738,7 +738,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
738738
return false;
739739
}
740740

741-
if (have_nohz_full_mask) {
741+
if (tick_nohz_full_running) {
742742
/*
743743
* Keep the tick alive to guarantee timekeeping progression
744744
* if there are full dynticks CPUs around

0 commit comments

Comments
 (0)