Skip to content

Commit ee1e714

Browse files
committed
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>
1 parent 677f664 commit ee1e714

5 files changed

Lines changed: 2 additions & 56 deletions

File tree

‎arch/sparc/kernel/smp_32.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,7 @@ static void sparc_start_secondary(void *arg)
352352
preempt_disable();
353353
cpu = smp_processor_id();
354354

355-
/* Invoke the CPU_STARTING notifier callbacks */
356355
notify_cpu_starting(cpu);
357-
358356
arch_cpu_pre_online(arg);
359357

360358
/* Set the CPU in the cpu_online_mask */

‎include/linux/cpu.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,8 @@ struct notifier_block;
6161
#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
6262
#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
6363
#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 */
6964
#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
7065
* 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 */
7566
#define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly,
7667
* perhaps due to preemption. */
7768

@@ -86,9 +77,6 @@ struct notifier_block;
8677
#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
8778
#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
8879
#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-
9280

9381
#ifdef CONFIG_SMP
9482
extern bool cpuhp_tasks_frozen;

‎include/linux/cpuhotplug.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ enum cpuhp_state {
6969
CPUHP_AP_ARM64_ISNDEP_STARTING,
7070
CPUHP_AP_SMPCFD_DYING,
7171
CPUHP_AP_X86_TBOOT_DYING,
72-
CPUHP_AP_NOTIFY_STARTING,
7372
CPUHP_AP_ONLINE,
7473
CPUHP_TEARDOWN_CPU,
7574
CPUHP_AP_ONLINE_IDLE,

‎kernel/cpu.c‎

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,6 @@ static int notify_online(unsigned int cpu)
408408
return 0;
409409
}
410410

411-
static int notify_starting(unsigned int cpu)
412-
{
413-
cpu_notify(CPU_STARTING, cpu);
414-
return 0;
415-
}
416-
417411
static int bringup_wait_for_ap(unsigned int cpu)
418412
{
419413
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
@@ -759,12 +753,6 @@ static int notify_down_prepare(unsigned int cpu)
759753
return err;
760754
}
761755

762-
static int notify_dying(unsigned int cpu)
763-
{
764-
cpu_notify(CPU_DYING, cpu);
765-
return 0;
766-
}
767-
768756
/* Take this CPU down. */
769757
static int take_cpu_down(void *_param)
770758
{
@@ -823,7 +811,7 @@ static int takedown_cpu(unsigned int cpu)
823811
BUG_ON(cpu_online(cpu));
824812

825813
/*
826-
* The migration_call() CPU_DYING callback will have removed all
814+
* The CPUHP_AP_SCHED_MIGRATE_DYING callback will have removed all
827815
* runnable tasks from the cpu, there's only the idle task left now
828816
* that the migration thread is done doing the stop_machine thing.
829817
*
@@ -876,7 +864,6 @@ void cpuhp_report_idle_dead(void)
876864
#define notify_down_prepare NULL
877865
#define takedown_cpu NULL
878866
#define notify_dead NULL
879-
#define notify_dying NULL
880867
#endif
881868

882869
#ifdef CONFIG_HOTPLUG_CPU
@@ -966,10 +953,9 @@ EXPORT_SYMBOL(cpu_down);
966953
#endif /*CONFIG_HOTPLUG_CPU*/
967954

968955
/**
969-
* notify_cpu_starting(cpu) - call the CPU_STARTING notifiers
956+
* notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU
970957
* @cpu: cpu that just started
971958
*
972-
* This function calls the cpu_chain notifiers with CPU_STARTING.
973959
* It must be called by the arch code on the new cpu, before the new cpu
974960
* enables interrupts and before the "boot" cpu returns from __cpu_up().
975961
*/
@@ -1365,18 +1351,6 @@ static struct cpuhp_step cpuhp_ap_states[] = {
13651351
.startup.single = NULL,
13661352
.teardown.single = rcutree_dying_cpu,
13671353
},
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-
},
13801354
/* Entry state on starting. Interrupts enabled from here on. Transient
13811355
* state for synchronsization */
13821356
[CPUHP_AP_ONLINE] = {

‎tools/testing/radix-tree/linux/cpu.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,8 @@
77
#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
88
#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
99
#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 */
1510
#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
1611
* 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. */
2312
#define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly,
2413
* perhaps due to preemption. */
2514
#define CPU_TASKS_FROZEN 0x0010
@@ -30,5 +19,3 @@
3019
#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
3120
#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
3221
#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)

0 commit comments

Comments
 (0)