aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-08-18 08:57:16 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-06 12:30:19 -0400
commitee1e714b94521b0bb27b04dfd1728ec51b19d4f0 (patch)
tree3e44c2b16f45998eae6ad3f935df22929741df31
parent677f6646533d701c8609b8bcb9304173c11cc194 (diff)
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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian 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.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/sparc/kernel/smp_32.c2
-rw-r--r--include/linux/cpu.h12
-rw-r--r--include/linux/cpuhotplug.h1
-rw-r--r--kernel/cpu.c30
-rw-r--r--tools/testing/radix-tree/linux/cpu.h13
5 files changed, 2 insertions, 56 deletions
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index fb30e7c6a5b1..e80e6ba3d500 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -352,9 +352,7 @@ static void sparc_start_secondary(void *arg)
352 preempt_disable(); 352 preempt_disable();
353 cpu = smp_processor_id(); 353 cpu = smp_processor_id();
354 354
355 /* Invoke the CPU_STARTING notifier callbacks */
356 notify_cpu_starting(cpu); 355 notify_cpu_starting(cpu);
357
358 arch_cpu_pre_online(arg); 356 arch_cpu_pre_online(arg);
359 357
360 /* Set the CPU in the cpu_online_mask */ 358 /* Set the CPU in the cpu_online_mask */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 797d9c8e9a1b..6bf1992fe638 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -61,17 +61,8 @@ struct notifier_block;
61#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ 61#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
62#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ 62#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
63#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 63#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
64#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
65 * not handling interrupts, soon dead.
66 * Called on the dying cpu, interrupts
67 * are already disabled. Must not
68 * sleep, must not fail */
69#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 64#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
70 * lock is dropped */ 65 * lock is dropped */
71#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
72 * Called on the new cpu, just before
73 * enabling interrupts. Must not sleep,
74 * must not fail */
75#define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly, 66#define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly,
76 * perhaps due to preemption. */ 67 * perhaps due to preemption. */
77 68
@@ -86,9 +77,6 @@ struct notifier_block;
86#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 77#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
87#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 78#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
88#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 79#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
89#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
90#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
91
92 80
93#ifdef CONFIG_SMP 81#ifdef CONFIG_SMP
94extern bool cpuhp_tasks_frozen; 82extern bool cpuhp_tasks_frozen;
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index b95f7adfbf8b..9e6d10786e29 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -69,7 +69,6 @@ enum cpuhp_state {
69 CPUHP_AP_ARM64_ISNDEP_STARTING, 69 CPUHP_AP_ARM64_ISNDEP_STARTING,
70 CPUHP_AP_SMPCFD_DYING, 70 CPUHP_AP_SMPCFD_DYING,
71 CPUHP_AP_X86_TBOOT_DYING, 71 CPUHP_AP_X86_TBOOT_DYING,
72 CPUHP_AP_NOTIFY_STARTING,
73 CPUHP_AP_ONLINE, 72 CPUHP_AP_ONLINE,
74 CPUHP_TEARDOWN_CPU, 73 CPUHP_TEARDOWN_CPU,
75 CPUHP_AP_ONLINE_IDLE, 74 CPUHP_AP_ONLINE_IDLE,
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 32eef273a0b9..d14ae4438e8e 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -408,12 +408,6 @@ static int notify_online(unsigned int cpu)
408 return 0; 408 return 0;
409} 409}
410 410
411static int notify_starting(unsigned int cpu)
412{
413 cpu_notify(CPU_STARTING, cpu);
414 return 0;
415}
416
417static int bringup_wait_for_ap(unsigned int cpu) 411static int bringup_wait_for_ap(unsigned int cpu)
418{ 412{
419 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); 413 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
@@ -759,12 +753,6 @@ static int notify_down_prepare(unsigned int cpu)
759 return err; 753 return err;
760} 754}
761 755
762static int notify_dying(unsigned int cpu)
763{
764 cpu_notify(CPU_DYING, cpu);
765 return 0;
766}
767
768/* Take this CPU down. */ 756/* Take this CPU down. */
769static int take_cpu_down(void *_param) 757static int take_cpu_down(void *_param)
770{ 758{
@@ -823,7 +811,7 @@ static int takedown_cpu(unsigned int cpu)
823 BUG_ON(cpu_online(cpu)); 811 BUG_ON(cpu_online(cpu));
824 812
825 /* 813 /*
826 * The migration_call() CPU_DYING callback will have removed all 814 * The CPUHP_AP_SCHED_MIGRATE_DYING callback will have removed all
827 * runnable tasks from the cpu, there's only the idle task left now 815 * runnable tasks from the cpu, there's only the idle task left now
828 * that the migration thread is done doing the stop_machine thing. 816 * that the migration thread is done doing the stop_machine thing.
829 * 817 *
@@ -876,7 +864,6 @@ void cpuhp_report_idle_dead(void)
876#define notify_down_prepare NULL 864#define notify_down_prepare NULL
877#define takedown_cpu NULL 865#define takedown_cpu NULL
878#define notify_dead NULL 866#define notify_dead NULL
879#define notify_dying NULL
880#endif 867#endif
881 868
882#ifdef CONFIG_HOTPLUG_CPU 869#ifdef CONFIG_HOTPLUG_CPU
@@ -966,10 +953,9 @@ EXPORT_SYMBOL(cpu_down);
966#endif /*CONFIG_HOTPLUG_CPU*/ 953#endif /*CONFIG_HOTPLUG_CPU*/
967 954
968/** 955/**
969 * notify_cpu_starting(cpu) - call the CPU_STARTING notifiers 956 * notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU
970 * @cpu: cpu that just started 957 * @cpu: cpu that just started
971 * 958 *
972 * This function calls the cpu_chain notifiers with CPU_STARTING.
973 * It must be called by the arch code on the new cpu, before the new cpu 959 * It must be called by the arch code on the new cpu, before the new cpu
974 * enables interrupts and before the "boot" cpu returns from __cpu_up(). 960 * enables interrupts and before the "boot" cpu returns from __cpu_up().
975 */ 961 */
@@ -1365,18 +1351,6 @@ static struct cpuhp_step cpuhp_ap_states[] = {
1365 .startup.single = NULL, 1351 .startup.single = NULL,
1366 .teardown.single = rcutree_dying_cpu, 1352 .teardown.single = rcutree_dying_cpu,
1367 }, 1353 },
1368 /*
1369 * Low level startup.single/teardown notifiers. Run with interrupts
1370 * disabled. Will be removed once the notifiers are converted to
1371 * states.
1372 */
1373 [CPUHP_AP_NOTIFY_STARTING] = {
1374 .name = "notify:starting",
1375 .startup.single = notify_starting,
1376 .teardown.single = notify_dying,
1377 .skip_onerr = true,
1378 .cant_stop = true,
1379 },
1380 /* Entry state on starting. Interrupts enabled from here on. Transient 1354 /* Entry state on starting. Interrupts enabled from here on. Transient
1381 * state for synchronsization */ 1355 * state for synchronsization */
1382 [CPUHP_AP_ONLINE] = { 1356 [CPUHP_AP_ONLINE] = {
diff --git a/tools/testing/radix-tree/linux/cpu.h b/tools/testing/radix-tree/linux/cpu.h
index 60a40459f269..7cf412103205 100644
--- a/tools/testing/radix-tree/linux/cpu.h
+++ b/tools/testing/radix-tree/linux/cpu.h
@@ -7,19 +7,8 @@
7#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ 7#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
8#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ 8#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
9#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 9#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
10#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
11 * not handling interrupts, soon dead.
12 * Called on the dying cpu, interrupts
13 * are already disabled. Must not
14 * sleep, must not fail */
15#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 10#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
16 * lock is dropped */ 11 * lock is dropped */
17#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
18 * Called on the new cpu, just before
19 * enabling interrupts. Must not sleep,
20 * must not fail */
21#define CPU_DYING_IDLE 0x000B /* CPU (unsigned)v dying, reached
22 * idle loop. */
23#define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly, 12#define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly,
24 * perhaps due to preemption. */ 13 * perhaps due to preemption. */
25#define CPU_TASKS_FROZEN 0x0010 14#define CPU_TASKS_FROZEN 0x0010
@@ -30,5 +19,3 @@
30#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 19#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
31#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 20#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
32#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 21#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
33#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
34#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)