Commit ee1e714b authored by Thomas Gleixner's avatar Thomas Gleixner

cpu/hotplug: Remove CPU_STARTING and CPU_DYING notifier

All users are converted to state machine, remove CPU_STARTING and the
corresponding CPU_DYING.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160818125731.27256-2-bigeasy@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 677f6646
...@@ -352,9 +352,7 @@ static void sparc_start_secondary(void *arg) ...@@ -352,9 +352,7 @@ static void sparc_start_secondary(void *arg)
preempt_disable(); preempt_disable();
cpu = smp_processor_id(); cpu = smp_processor_id();
/* Invoke the CPU_STARTING notifier callbacks */
notify_cpu_starting(cpu); notify_cpu_starting(cpu);
arch_cpu_pre_online(arg); arch_cpu_pre_online(arg);
/* Set the CPU in the cpu_online_mask */ /* Set the CPU in the cpu_online_mask */
......
...@@ -61,17 +61,8 @@ struct notifier_block; ...@@ -61,17 +61,8 @@ struct notifier_block;
#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
* not handling interrupts, soon dead.
* Called on the dying cpu, interrupts
* are already disabled. Must not
* sleep, must not fail */
#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
* lock is dropped */ * lock is dropped */
#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
* Called on the new cpu, just before
* enabling interrupts. Must not sleep,
* must not fail */
#define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly, #define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly,
* perhaps due to preemption. */ * perhaps due to preemption. */
...@@ -86,9 +77,6 @@ struct notifier_block; ...@@ -86,9 +77,6 @@ struct notifier_block;
#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern bool cpuhp_tasks_frozen; extern bool cpuhp_tasks_frozen;
......
...@@ -69,7 +69,6 @@ enum cpuhp_state { ...@@ -69,7 +69,6 @@ enum cpuhp_state {
CPUHP_AP_ARM64_ISNDEP_STARTING, CPUHP_AP_ARM64_ISNDEP_STARTING,
CPUHP_AP_SMPCFD_DYING, CPUHP_AP_SMPCFD_DYING,
CPUHP_AP_X86_TBOOT_DYING, CPUHP_AP_X86_TBOOT_DYING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE, CPUHP_AP_ONLINE,
CPUHP_TEARDOWN_CPU, CPUHP_TEARDOWN_CPU,
CPUHP_AP_ONLINE_IDLE, CPUHP_AP_ONLINE_IDLE,
......
...@@ -408,12 +408,6 @@ static int notify_online(unsigned int cpu) ...@@ -408,12 +408,6 @@ static int notify_online(unsigned int cpu)
return 0; return 0;
} }
static int notify_starting(unsigned int cpu)
{
cpu_notify(CPU_STARTING, cpu);
return 0;
}
static int bringup_wait_for_ap(unsigned int cpu) static int bringup_wait_for_ap(unsigned int cpu)
{ {
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
...@@ -759,12 +753,6 @@ static int notify_down_prepare(unsigned int cpu) ...@@ -759,12 +753,6 @@ static int notify_down_prepare(unsigned int cpu)
return err; return err;
} }
static int notify_dying(unsigned int cpu)
{
cpu_notify(CPU_DYING, cpu);
return 0;
}
/* Take this CPU down. */ /* Take this CPU down. */
static int take_cpu_down(void *_param) static int take_cpu_down(void *_param)
{ {
...@@ -823,7 +811,7 @@ static int takedown_cpu(unsigned int cpu) ...@@ -823,7 +811,7 @@ static int takedown_cpu(unsigned int cpu)
BUG_ON(cpu_online(cpu)); BUG_ON(cpu_online(cpu));
/* /*
* The migration_call() CPU_DYING callback will have removed all * The CPUHP_AP_SCHED_MIGRATE_DYING callback will have removed all
* runnable tasks from the cpu, there's only the idle task left now * runnable tasks from the cpu, there's only the idle task left now
* that the migration thread is done doing the stop_machine thing. * that the migration thread is done doing the stop_machine thing.
* *
...@@ -876,7 +864,6 @@ void cpuhp_report_idle_dead(void) ...@@ -876,7 +864,6 @@ void cpuhp_report_idle_dead(void)
#define notify_down_prepare NULL #define notify_down_prepare NULL
#define takedown_cpu NULL #define takedown_cpu NULL
#define notify_dead NULL #define notify_dead NULL
#define notify_dying NULL
#endif #endif
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
...@@ -966,10 +953,9 @@ EXPORT_SYMBOL(cpu_down); ...@@ -966,10 +953,9 @@ EXPORT_SYMBOL(cpu_down);
#endif /*CONFIG_HOTPLUG_CPU*/ #endif /*CONFIG_HOTPLUG_CPU*/
/** /**
* notify_cpu_starting(cpu) - call the CPU_STARTING notifiers * notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU
* @cpu: cpu that just started * @cpu: cpu that just started
* *
* This function calls the cpu_chain notifiers with CPU_STARTING.
* It must be called by the arch code on the new cpu, before the new cpu * It must be called by the arch code on the new cpu, before the new cpu
* enables interrupts and before the "boot" cpu returns from __cpu_up(). * enables interrupts and before the "boot" cpu returns from __cpu_up().
*/ */
...@@ -1365,18 +1351,6 @@ static struct cpuhp_step cpuhp_ap_states[] = { ...@@ -1365,18 +1351,6 @@ static struct cpuhp_step cpuhp_ap_states[] = {
.startup.single = NULL, .startup.single = NULL,
.teardown.single = rcutree_dying_cpu, .teardown.single = rcutree_dying_cpu,
}, },
/*
* Low level startup.single/teardown notifiers. Run with interrupts
* disabled. Will be removed once the notifiers are converted to
* states.
*/
[CPUHP_AP_NOTIFY_STARTING] = {
.name = "notify:starting",
.startup.single = notify_starting,
.teardown.single = notify_dying,
.skip_onerr = true,
.cant_stop = true,
},
/* Entry state on starting. Interrupts enabled from here on. Transient /* Entry state on starting. Interrupts enabled from here on. Transient
* state for synchronsization */ * state for synchronsization */
[CPUHP_AP_ONLINE] = { [CPUHP_AP_ONLINE] = {
......
...@@ -7,19 +7,8 @@ ...@@ -7,19 +7,8 @@
#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
* not handling interrupts, soon dead.
* Called on the dying cpu, interrupts
* are already disabled. Must not
* sleep, must not fail */
#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
* lock is dropped */ * lock is dropped */
#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
* Called on the new cpu, just before
* enabling interrupts. Must not sleep,
* must not fail */
#define CPU_DYING_IDLE 0x000B /* CPU (unsigned)v dying, reached
* idle loop. */
#define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly, #define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly,
* perhaps due to preemption. */ * perhaps due to preemption. */
#define CPU_TASKS_FROZEN 0x0010 #define CPU_TASKS_FROZEN 0x0010
...@@ -30,5 +19,3 @@ ...@@ -30,5 +19,3 @@
#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
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