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

Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull hotplug API fix from Ingo Molnar:
"Late breaking fix from the v4.9 cycle: fix a hotplug register/
unregister notifier API asymmetry bug that can cause kernel warnings
(and worse) with certain Kconfig combinations"

* 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
hotplug: Make register and unregister notifier API symmetric

+5 -12
+4 -11
include/linux/cpu.h
··· 93 93 { .notifier_call = fn, .priority = pri }; \ 94 94 __register_cpu_notifier(&fn##_nb); \ 95 95 } 96 - #else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ 97 - #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) 98 - #define __cpu_notifier(fn, pri) do { (void)(fn); } while (0) 99 - #endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ 100 96 101 - #ifdef CONFIG_HOTPLUG_CPU 102 97 extern int register_cpu_notifier(struct notifier_block *nb); 103 98 extern int __register_cpu_notifier(struct notifier_block *nb); 104 99 extern void unregister_cpu_notifier(struct notifier_block *nb); 105 100 extern void __unregister_cpu_notifier(struct notifier_block *nb); 106 - #else 107 101 108 - #ifndef MODULE 109 - extern int register_cpu_notifier(struct notifier_block *nb); 110 - extern int __register_cpu_notifier(struct notifier_block *nb); 111 - #else 102 + #else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ 103 + #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) 104 + #define __cpu_notifier(fn, pri) do { (void)(fn); } while (0) 105 + 112 106 static inline int register_cpu_notifier(struct notifier_block *nb) 113 107 { 114 108 return 0; ··· 112 118 { 113 119 return 0; 114 120 } 115 - #endif 116 121 117 122 static inline void unregister_cpu_notifier(struct notifier_block *nb) 118 123 {
+1 -1
kernel/cpu.c
··· 659 659 kthread_unpark(this_cpu_read(cpuhp_state.thread)); 660 660 } 661 661 662 - #ifdef CONFIG_HOTPLUG_CPU 663 662 EXPORT_SYMBOL(register_cpu_notifier); 664 663 EXPORT_SYMBOL(__register_cpu_notifier); 665 664 void unregister_cpu_notifier(struct notifier_block *nb) ··· 675 676 } 676 677 EXPORT_SYMBOL(__unregister_cpu_notifier); 677 678 679 + #ifdef CONFIG_HOTPLUG_CPU 678 680 /** 679 681 * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU 680 682 * @cpu: a CPU id