Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -56
-2
arch/sparc/kernel/smp_32.c
··· 352 352 preempt_disable(); 353 353 cpu = smp_processor_id(); 354 354 355 - /* Invoke the CPU_STARTING notifier callbacks */ 356 355 notify_cpu_starting(cpu); 357 - 358 356 arch_cpu_pre_online(arg); 359 357 360 358 /* Set the CPU in the cpu_online_mask */
-12
include/linux/cpu.h
··· 61 61 #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ 62 62 #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ 63 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 64 #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 70 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 66 #define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly, 76 67 * perhaps due to preemption. */ 77 68 ··· 77 86 #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 78 87 #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 79 88 #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 80 - #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) 81 - #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) 82 - 83 89 84 90 #ifdef CONFIG_SMP 85 91 extern bool cpuhp_tasks_frozen;
-1
include/linux/cpuhotplug.h
··· 69 69 CPUHP_AP_ARM64_ISNDEP_STARTING, 70 70 CPUHP_AP_SMPCFD_DYING, 71 71 CPUHP_AP_X86_TBOOT_DYING, 72 - CPUHP_AP_NOTIFY_STARTING, 73 72 CPUHP_AP_ONLINE, 74 73 CPUHP_TEARDOWN_CPU, 75 74 CPUHP_AP_ONLINE_IDLE,
+2 -28
kernel/cpu.c
··· 408 408 return 0; 409 409 } 410 410 411 - static int notify_starting(unsigned int cpu) 412 - { 413 - cpu_notify(CPU_STARTING, cpu); 414 - return 0; 415 - } 416 - 417 411 static int bringup_wait_for_ap(unsigned int cpu) 418 412 { 419 413 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); ··· 753 759 return err; 754 760 } 755 761 756 - static int notify_dying(unsigned int cpu) 757 - { 758 - cpu_notify(CPU_DYING, cpu); 759 - return 0; 760 - } 761 - 762 762 /* Take this CPU down. */ 763 763 static int take_cpu_down(void *_param) 764 764 { ··· 811 823 BUG_ON(cpu_online(cpu)); 812 824 813 825 /* 814 - * The migration_call() CPU_DYING callback will have removed all 826 + * The CPUHP_AP_SCHED_MIGRATE_DYING callback will have removed all 815 827 * runnable tasks from the cpu, there's only the idle task left now 816 828 * that the migration thread is done doing the stop_machine thing. 817 829 * ··· 864 876 #define notify_down_prepare NULL 865 877 #define takedown_cpu NULL 866 878 #define notify_dead NULL 867 - #define notify_dying NULL 868 879 #endif 869 880 870 881 #ifdef CONFIG_HOTPLUG_CPU ··· 953 966 #endif /*CONFIG_HOTPLUG_CPU*/ 954 967 955 968 /** 956 - * notify_cpu_starting(cpu) - call the CPU_STARTING notifiers 969 + * notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU 957 970 * @cpu: cpu that just started 958 971 * 959 - * This function calls the cpu_chain notifiers with CPU_STARTING. 960 972 * It must be called by the arch code on the new cpu, before the new cpu 961 973 * enables interrupts and before the "boot" cpu returns from __cpu_up(). 962 974 */ ··· 1350 1364 .name = "RCU/tree:dying", 1351 1365 .startup.single = NULL, 1352 1366 .teardown.single = rcutree_dying_cpu, 1353 - }, 1354 - /* 1355 - * Low level startup.single/teardown notifiers. Run with interrupts 1356 - * disabled. Will be removed once the notifiers are converted to 1357 - * states. 1358 - */ 1359 - [CPUHP_AP_NOTIFY_STARTING] = { 1360 - .name = "notify:starting", 1361 - .startup.single = notify_starting, 1362 - .teardown.single = notify_dying, 1363 - .skip_onerr = true, 1364 - .cant_stop = true, 1365 1367 }, 1366 1368 /* Entry state on starting. Interrupts enabled from here on. Transient 1367 1369 * state for synchronsization */
-13
tools/testing/radix-tree/linux/cpu.h
··· 7 7 #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ 8 8 #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ 9 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 10 #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 16 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 12 #define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly, 24 13 * perhaps due to preemption. */ 25 14 #define CPU_TASKS_FROZEN 0x0010 ··· 19 30 #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 20 31 #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 21 32 #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 22 - #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) 23 - #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)