[RFC PATCH(Experimental) 4/4] Rip out lock_cpu_hotplug from linux.
This patch rips out lock_cpu_hotplug from the kernel. Good Riddance!! (hopefully :) ) Signed-off-by : Gautham R Shenoy <[EMAIL PROTECTED]> -- arch/i386/kernel/cpu/mtrr/main.c |6 -- arch/i386/kernel/microcode.c |8 arch/mips/kernel/mips-mt.c |5 - arch/powerpc/platforms/pseries/hotplug-cpu.c |5 - arch/powerpc/platforms/pseries/rtasd.c |4 include/linux/cpu.h | 20 kernel/cpu.c | 17 - kernel/rcutorture.c |3 --- kernel/stop_machine.c|3 --- net/core/flow.c |2 -- 10 files changed, 73 deletions(-) Index: hotplug/include/linux/cpu.h === --- hotplug.orig/include/linux/cpu.h +++ hotplug/include/linux/cpu.h @@ -76,18 +76,6 @@ extern struct sysdev_class cpu_sysdev_cl #ifdef CONFIG_HOTPLUG_CPU /* Stop CPUs going up and down. */ -static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex) -{ - mutex_lock(cpu_hp_mutex); -} - -static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) -{ - mutex_unlock(cpu_hp_mutex); -} - -extern void lock_cpu_hotplug(void); -extern void unlock_cpu_hotplug(void); #define hotcpu_notifier(fn, pri) { \ static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ @@ -100,14 +88,6 @@ int cpu_down(unsigned int cpu); #else /* CONFIG_HOTPLUG_CPU */ -static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex) -{ } -static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) -{ } - -#define lock_cpu_hotplug() do { } while (0) -#define unlock_cpu_hotplug() do { } while (0) -#define lock_cpu_hotplug_interruptible() 0 #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) Index: hotplug/kernel/cpu.c === --- hotplug.orig/kernel/cpu.c +++ hotplug/kernel/cpu.c @@ -18,7 +18,6 @@ /* This protects CPUs going up and down... */ static DEFINE_MUTEX(cpu_add_remove_lock); -static DEFINE_MUTEX(cpu_bitmask_lock); static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); @@ -27,22 +26,6 @@ static __cpuinitdata RAW_NOTIFIER_HEAD(c */ static int cpu_hotplug_disabled; -#ifdef CONFIG_HOTPLUG_CPU - -void lock_cpu_hotplug(void) -{ - return; -} -EXPORT_SYMBOL_GPL(lock_cpu_hotplug); - -void unlock_cpu_hotplug(void) -{ - return; -} -EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); - -#endif /* CONFIG_HOTPLUG_CPU */ - /* Need to know about CPUs going up/down? */ int __cpuinit register_cpu_notifier(struct notifier_block *nb) { Index: hotplug/arch/i386/kernel/cpu/mtrr/main.c === --- hotplug.orig/arch/i386/kernel/cpu/mtrr/main.c +++ hotplug/arch/i386/kernel/cpu/mtrr/main.c @@ -346,8 +346,6 @@ int mtrr_add_page(unsigned long base, un error = -EINVAL; replace = -1; - /* No CPU hotplug when we change MTRR entries */ - lock_cpu_hotplug(); /* Search for existing MTRR */ mutex_lock(_mutex); for (i = 0; i < num_var_ranges; ++i) { @@ -403,7 +401,6 @@ int mtrr_add_page(unsigned long base, un error = i; out: mutex_unlock(_mutex); - unlock_cpu_hotplug(); return error; } @@ -492,8 +489,6 @@ int mtrr_del_page(int reg, unsigned long return -ENXIO; max = num_var_ranges; - /* No CPU hotplug when we change MTRR entries */ - lock_cpu_hotplug(); mutex_lock(_mutex); if (reg < 0) { /* Search for existing MTRR */ @@ -534,7 +529,6 @@ int mtrr_del_page(int reg, unsigned long error = reg; out: mutex_unlock(_mutex); - unlock_cpu_hotplug(); return error; } /** Index: hotplug/arch/i386/kernel/microcode.c === --- hotplug.orig/arch/i386/kernel/microcode.c +++ hotplug/arch/i386/kernel/microcode.c @@ -435,7 +435,6 @@ static ssize_t microcode_write (struct f return -EINVAL; } - lock_cpu_hotplug(); mutex_lock(_mutex); user_buffer = (void __user *) buf; @@ -446,7 +445,6 @@ static ssize_t microcode_write (struct f ret = (ssize_t)len; mutex_unlock(_mutex); - unlock_cpu_hotplug(); return ret; } @@ -609,14 +607,12 @@ static ssize_t reload_store(struct sys_d old = current->cpus_allowed; - lock_cpu_hotplug(); set_cpus_allowed(current, cpumask_of_cpu(cpu));
[RFC PATCH(Experimental) 4/4] Rip out lock_cpu_hotplug from linux.
This patch rips out lock_cpu_hotplug from the kernel. Good Riddance!! (hopefully :) ) Signed-off-by : Gautham R Shenoy [EMAIL PROTECTED] -- arch/i386/kernel/cpu/mtrr/main.c |6 -- arch/i386/kernel/microcode.c |8 arch/mips/kernel/mips-mt.c |5 - arch/powerpc/platforms/pseries/hotplug-cpu.c |5 - arch/powerpc/platforms/pseries/rtasd.c |4 include/linux/cpu.h | 20 kernel/cpu.c | 17 - kernel/rcutorture.c |3 --- kernel/stop_machine.c|3 --- net/core/flow.c |2 -- 10 files changed, 73 deletions(-) Index: hotplug/include/linux/cpu.h === --- hotplug.orig/include/linux/cpu.h +++ hotplug/include/linux/cpu.h @@ -76,18 +76,6 @@ extern struct sysdev_class cpu_sysdev_cl #ifdef CONFIG_HOTPLUG_CPU /* Stop CPUs going up and down. */ -static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex) -{ - mutex_lock(cpu_hp_mutex); -} - -static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) -{ - mutex_unlock(cpu_hp_mutex); -} - -extern void lock_cpu_hotplug(void); -extern void unlock_cpu_hotplug(void); #define hotcpu_notifier(fn, pri) { \ static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ @@ -100,14 +88,6 @@ int cpu_down(unsigned int cpu); #else /* CONFIG_HOTPLUG_CPU */ -static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex) -{ } -static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) -{ } - -#define lock_cpu_hotplug() do { } while (0) -#define unlock_cpu_hotplug() do { } while (0) -#define lock_cpu_hotplug_interruptible() 0 #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) Index: hotplug/kernel/cpu.c === --- hotplug.orig/kernel/cpu.c +++ hotplug/kernel/cpu.c @@ -18,7 +18,6 @@ /* This protects CPUs going up and down... */ static DEFINE_MUTEX(cpu_add_remove_lock); -static DEFINE_MUTEX(cpu_bitmask_lock); static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); @@ -27,22 +26,6 @@ static __cpuinitdata RAW_NOTIFIER_HEAD(c */ static int cpu_hotplug_disabled; -#ifdef CONFIG_HOTPLUG_CPU - -void lock_cpu_hotplug(void) -{ - return; -} -EXPORT_SYMBOL_GPL(lock_cpu_hotplug); - -void unlock_cpu_hotplug(void) -{ - return; -} -EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); - -#endif /* CONFIG_HOTPLUG_CPU */ - /* Need to know about CPUs going up/down? */ int __cpuinit register_cpu_notifier(struct notifier_block *nb) { Index: hotplug/arch/i386/kernel/cpu/mtrr/main.c === --- hotplug.orig/arch/i386/kernel/cpu/mtrr/main.c +++ hotplug/arch/i386/kernel/cpu/mtrr/main.c @@ -346,8 +346,6 @@ int mtrr_add_page(unsigned long base, un error = -EINVAL; replace = -1; - /* No CPU hotplug when we change MTRR entries */ - lock_cpu_hotplug(); /* Search for existing MTRR */ mutex_lock(mtrr_mutex); for (i = 0; i num_var_ranges; ++i) { @@ -403,7 +401,6 @@ int mtrr_add_page(unsigned long base, un error = i; out: mutex_unlock(mtrr_mutex); - unlock_cpu_hotplug(); return error; } @@ -492,8 +489,6 @@ int mtrr_del_page(int reg, unsigned long return -ENXIO; max = num_var_ranges; - /* No CPU hotplug when we change MTRR entries */ - lock_cpu_hotplug(); mutex_lock(mtrr_mutex); if (reg 0) { /* Search for existing MTRR */ @@ -534,7 +529,6 @@ int mtrr_del_page(int reg, unsigned long error = reg; out: mutex_unlock(mtrr_mutex); - unlock_cpu_hotplug(); return error; } /** Index: hotplug/arch/i386/kernel/microcode.c === --- hotplug.orig/arch/i386/kernel/microcode.c +++ hotplug/arch/i386/kernel/microcode.c @@ -435,7 +435,6 @@ static ssize_t microcode_write (struct f return -EINVAL; } - lock_cpu_hotplug(); mutex_lock(microcode_mutex); user_buffer = (void __user *) buf; @@ -446,7 +445,6 @@ static ssize_t microcode_write (struct f ret = (ssize_t)len; mutex_unlock(microcode_mutex); - unlock_cpu_hotplug(); return ret; } @@ -609,14 +607,12 @@ static ssize_t reload_store(struct sys_d old = current-cpus_allowed; - lock_cpu_hotplug();