Commit 73867dcd authored by Frederic Weisbecker's avatar Frederic Weisbecker

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: default avatarFrederic 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>
parent af2350bd
...@@ -149,8 +149,8 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) ...@@ -149,8 +149,8 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
} }
#ifdef CONFIG_NO_HZ_FULL #ifdef CONFIG_NO_HZ_FULL
static cpumask_var_t nohz_full_mask; static cpumask_var_t tick_nohz_full_mask;
bool have_nohz_full_mask; bool tick_nohz_full_running;
static bool can_stop_full_tick(void) static bool can_stop_full_tick(void)
{ {
...@@ -183,7 +183,7 @@ static bool can_stop_full_tick(void) ...@@ -183,7 +183,7 @@ static bool can_stop_full_tick(void)
* Don't allow the user to think they can get * Don't allow the user to think they can get
* full NO_HZ with this machine. * full NO_HZ with this machine.
*/ */
WARN_ONCE(have_nohz_full_mask, WARN_ONCE(tick_nohz_full_running,
"NO_HZ FULL will not work with unstable sched clock"); "NO_HZ FULL will not work with unstable sched clock");
return false; return false;
} }
...@@ -240,11 +240,11 @@ static void nohz_full_kick_ipi(void *info) ...@@ -240,11 +240,11 @@ static void nohz_full_kick_ipi(void *info)
*/ */
void tick_nohz_full_kick_all(void) void tick_nohz_full_kick_all(void)
{ {
if (!have_nohz_full_mask) if (!tick_nohz_full_running)
return; return;
preempt_disable(); preempt_disable();
smp_call_function_many(nohz_full_mask, smp_call_function_many(tick_nohz_full_mask,
nohz_full_kick_ipi, NULL, false); nohz_full_kick_ipi, NULL, false);
preempt_enable(); preempt_enable();
} }
...@@ -272,10 +272,10 @@ void tick_nohz_task_switch(struct task_struct *tsk) ...@@ -272,10 +272,10 @@ void tick_nohz_task_switch(struct task_struct *tsk)
int tick_nohz_full_cpu(int cpu) int tick_nohz_full_cpu(int cpu)
{ {
if (!have_nohz_full_mask) if (!tick_nohz_full_running)
return 0; return 0;
return cpumask_test_cpu(cpu, nohz_full_mask); return cpumask_test_cpu(cpu, tick_nohz_full_mask);
} }
/* Parse the boot-time nohz CPU list from the kernel parameters. */ /* Parse the boot-time nohz CPU list from the kernel parameters. */
...@@ -283,18 +283,18 @@ static int __init tick_nohz_full_setup(char *str) ...@@ -283,18 +283,18 @@ static int __init tick_nohz_full_setup(char *str)
{ {
int cpu; int cpu;
alloc_bootmem_cpumask_var(&nohz_full_mask); alloc_bootmem_cpumask_var(&tick_nohz_full_mask);
if (cpulist_parse(str, nohz_full_mask) < 0) { if (cpulist_parse(str, tick_nohz_full_mask) < 0) {
pr_warning("NOHZ: Incorrect nohz_full cpumask\n"); pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
return 1; return 1;
} }
cpu = smp_processor_id(); cpu = smp_processor_id();
if (cpumask_test_cpu(cpu, nohz_full_mask)) { if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
pr_warning("NO_HZ: Clearing %d from nohz_full range for timekeeping\n", cpu); pr_warning("NO_HZ: Clearing %d from nohz_full range for timekeeping\n", cpu);
cpumask_clear_cpu(cpu, nohz_full_mask); cpumask_clear_cpu(cpu, tick_nohz_full_mask);
} }
have_nohz_full_mask = true; tick_nohz_full_running = true;
return 1; return 1;
} }
...@@ -312,7 +312,7 @@ static int tick_nohz_cpu_down_callback(struct notifier_block *nfb, ...@@ -312,7 +312,7 @@ static int tick_nohz_cpu_down_callback(struct notifier_block *nfb,
* If we handle the timekeeping duty for full dynticks CPUs, * If we handle the timekeeping duty for full dynticks CPUs,
* we can't safely shutdown that CPU. * we can't safely shutdown that CPU.
*/ */
if (have_nohz_full_mask && tick_do_timer_cpu == cpu) if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
return NOTIFY_BAD; return NOTIFY_BAD;
break; break;
} }
...@@ -331,14 +331,14 @@ static int tick_nohz_init_all(void) ...@@ -331,14 +331,14 @@ static int tick_nohz_init_all(void)
int err = -1; int err = -1;
#ifdef CONFIG_NO_HZ_FULL_ALL #ifdef CONFIG_NO_HZ_FULL_ALL
if (!alloc_cpumask_var(&nohz_full_mask, GFP_KERNEL)) { if (!alloc_cpumask_var(&tick_nohz_full_mask, GFP_KERNEL)) {
pr_err("NO_HZ: Can't allocate full dynticks cpumask\n"); pr_err("NO_HZ: Can't allocate full dynticks cpumask\n");
return err; return err;
} }
err = 0; err = 0;
cpumask_setall(nohz_full_mask); cpumask_setall(tick_nohz_full_mask);
cpumask_clear_cpu(smp_processor_id(), nohz_full_mask); cpumask_clear_cpu(smp_processor_id(), tick_nohz_full_mask);
have_nohz_full_mask = true; tick_nohz_full_running = true;
#endif #endif
return err; return err;
} }
...@@ -347,20 +347,20 @@ void __init tick_nohz_init(void) ...@@ -347,20 +347,20 @@ void __init tick_nohz_init(void)
{ {
int cpu; int cpu;
if (!have_nohz_full_mask) { if (!tick_nohz_full_running) {
if (tick_nohz_init_all() < 0) if (tick_nohz_init_all() < 0)
return; return;
} }
for_each_cpu(cpu, nohz_full_mask) for_each_cpu(cpu, tick_nohz_full_mask)
context_tracking_cpu_set(cpu); context_tracking_cpu_set(cpu);
cpu_notifier(tick_nohz_cpu_down_callback, 0); cpu_notifier(tick_nohz_cpu_down_callback, 0);
cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), nohz_full_mask); cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), tick_nohz_full_mask);
pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf); pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
} }
#else #else
#define have_nohz_full_mask (0) #define tick_nohz_full_running (0)
#endif #endif
/* /*
...@@ -738,7 +738,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) ...@@ -738,7 +738,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
return false; return false;
} }
if (have_nohz_full_mask) { if (tick_nohz_full_running) {
/* /*
* Keep the tick alive to guarantee timekeeping progression * Keep the tick alive to guarantee timekeeping progression
* if there are full dynticks CPUs around * if there are full dynticks CPUs around
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment