mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-09 12:53:20 +00:00
sched/nohz: Convert to hotplug state machine
Install the callbacks via the state machine. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: rt@linuxtronix.de Link: http://lkml.kernel.org/r/20161117183541.8588-14-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
38b482929e
commit
31eff2434d
@ -390,24 +390,16 @@ static int __init tick_nohz_full_setup(char *str)
|
|||||||
}
|
}
|
||||||
__setup("nohz_full=", tick_nohz_full_setup);
|
__setup("nohz_full=", tick_nohz_full_setup);
|
||||||
|
|
||||||
static int tick_nohz_cpu_down_callback(struct notifier_block *nfb,
|
static int tick_nohz_cpu_down(unsigned int cpu)
|
||||||
unsigned long action,
|
|
||||||
void *hcpu)
|
|
||||||
{
|
{
|
||||||
unsigned int cpu = (unsigned long)hcpu;
|
/*
|
||||||
|
* The boot CPU handles housekeeping duty (unbound timers,
|
||||||
switch (action & ~CPU_TASKS_FROZEN) {
|
* workqueues, timekeeping, ...) on behalf of full dynticks
|
||||||
case CPU_DOWN_PREPARE:
|
* CPUs. It must remain online when nohz full is enabled.
|
||||||
/*
|
*/
|
||||||
* The boot CPU handles housekeeping duty (unbound timers,
|
if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
|
||||||
* workqueues, timekeeping, ...) on behalf of full dynticks
|
return -EBUSY;
|
||||||
* CPUs. It must remain online when nohz full is enabled.
|
return 0;
|
||||||
*/
|
|
||||||
if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
|
|
||||||
return NOTIFY_BAD;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return NOTIFY_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tick_nohz_init_all(void)
|
static int tick_nohz_init_all(void)
|
||||||
@ -428,7 +420,7 @@ static int tick_nohz_init_all(void)
|
|||||||
|
|
||||||
void __init tick_nohz_init(void)
|
void __init tick_nohz_init(void)
|
||||||
{
|
{
|
||||||
int cpu;
|
int cpu, ret;
|
||||||
|
|
||||||
if (!tick_nohz_full_running) {
|
if (!tick_nohz_full_running) {
|
||||||
if (tick_nohz_init_all() < 0)
|
if (tick_nohz_init_all() < 0)
|
||||||
@ -469,7 +461,10 @@ void __init tick_nohz_init(void)
|
|||||||
for_each_cpu(cpu, tick_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);
|
ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
|
||||||
|
"kernel/nohz:predown", NULL,
|
||||||
|
tick_nohz_cpu_down);
|
||||||
|
WARN_ON(ret < 0);
|
||||||
pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
|
pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
|
||||||
cpumask_pr_args(tick_nohz_full_mask));
|
cpumask_pr_args(tick_nohz_full_mask));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user