The patch titled cpu hotplug: make [un]register_cpu_notifier init time only has been removed from the -mm tree. Its filename is cpu-hotplug-make-register_cpu_notifier-init-time-only.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: cpu hotplug: make [un]register_cpu_notifier init time only From: Chandra Seetharaman <sekharan@xxxxxxxxxx> CPUs come online only at init time (unless CONFIG_HOTPLUG_CPU is defined). So, cpu_notifier functionality need to be available only at init time. This patch makes register_cpu_notifier() available only at init time, unless CONFIG_HOTPLUG_CPU is defined. This patch exports register_cpu_notifier() and unregister_cpu_notifier() only if CONFIG_HOTPLUG_CPU is defined. Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx> Cc: Ashok Raj <ashok.raj@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/cpufreq/cpufreq.c | 8 +++++--- drivers/cpufreq/cpufreq_stats.c | 4 ++-- include/linux/cpu.h | 6 ++++++ kernel/cpu.c | 8 +++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff -puN drivers/cpufreq/cpufreq.c~cpu-hotplug-make-register_cpu_notifier-init-time-only drivers/cpufreq/cpufreq.c --- a/drivers/cpufreq/cpufreq.c~cpu-hotplug-make-register_cpu_notifier-init-time-only +++ a/drivers/cpufreq/cpufreq.c @@ -1497,7 +1497,8 @@ int cpufreq_update_policy(unsigned int c } EXPORT_SYMBOL(cpufreq_update_policy); -static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, +#ifdef CONFIG_HOTPLUG_CPU +static int cpufreq_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -1536,6 +1537,7 @@ static struct notifier_block cpufreq_cpu { .notifier_call = cpufreq_cpu_callback, }; +#endif /* CONFIG_HOTPLUG_CPU */ /********************************************************************* * REGISTER / UNREGISTER CPUFREQ DRIVER * @@ -1596,7 +1598,7 @@ int cpufreq_register_driver(struct cpufr } if (!ret) { - register_cpu_notifier(&cpufreq_cpu_notifier); + register_hotcpu_notifier(&cpufreq_cpu_notifier); dprintk("driver %s up and running\n", driver_data->name); cpufreq_debug_enable_ratelimit(); } @@ -1628,7 +1630,7 @@ int cpufreq_unregister_driver(struct cpu dprintk("unregistering driver %s\n", driver->name); sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver); - unregister_cpu_notifier(&cpufreq_cpu_notifier); + unregister_hotcpu_notifier(&cpufreq_cpu_notifier); spin_lock_irqsave(&cpufreq_driver_lock, flags); cpufreq_driver = NULL; diff -puN drivers/cpufreq/cpufreq_stats.c~cpu-hotplug-make-register_cpu_notifier-init-time-only drivers/cpufreq/cpufreq_stats.c --- a/drivers/cpufreq/cpufreq_stats.c~cpu-hotplug-make-register_cpu_notifier-init-time-only +++ a/drivers/cpufreq/cpufreq_stats.c @@ -350,7 +350,7 @@ __init cpufreq_stats_init(void) return ret; } - register_cpu_notifier(&cpufreq_stat_cpu_notifier); + register_hotcpu_notifier(&cpufreq_stat_cpu_notifier); lock_cpu_hotplug(); for_each_online_cpu(cpu) { cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_ONLINE, @@ -368,7 +368,7 @@ __exit cpufreq_stats_exit(void) CPUFREQ_POLICY_NOTIFIER); cpufreq_unregister_notifier(¬ifier_trans_block, CPUFREQ_TRANSITION_NOTIFIER); - unregister_cpu_notifier(&cpufreq_stat_cpu_notifier); + unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); lock_cpu_hotplug(); for_each_online_cpu(cpu) { cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_DEAD, diff -puN include/linux/cpu.h~cpu-hotplug-make-register_cpu_notifier-init-time-only include/linux/cpu.h --- a/include/linux/cpu.h~cpu-hotplug-make-register_cpu_notifier-init-time-only +++ a/include/linux/cpu.h @@ -41,7 +41,13 @@ struct notifier_block; #ifdef CONFIG_SMP /* Need to know about CPUs going up/down? */ extern int register_cpu_notifier(struct notifier_block *nb); +#ifdef CONFIG_HOTPLUG_CPU extern void unregister_cpu_notifier(struct notifier_block *nb); +#else +static inline void unregister_cpu_notifier(struct notifier_block *nb) +{ +} +#endif extern int current_in_cpu_hotplug(void); int cpu_up(unsigned int cpu); diff -puN kernel/cpu.c~cpu-hotplug-make-register_cpu_notifier-init-time-only kernel/cpu.c --- a/kernel/cpu.c~cpu-hotplug-make-register_cpu_notifier-init-time-only +++ a/kernel/cpu.c @@ -18,7 +18,7 @@ /* This protects CPUs going up and down... */ static DEFINE_MUTEX(cpucontrol); -static BLOCKING_NOTIFIER_HEAD(cpu_chain); +static __cpuinitdata BLOCKING_NOTIFIER_HEAD(cpu_chain); #ifdef CONFIG_HOTPLUG_CPU static struct task_struct *lock_cpu_hotplug_owner; @@ -69,10 +69,13 @@ EXPORT_SYMBOL_GPL(lock_cpu_hotplug_inter #endif /* CONFIG_HOTPLUG_CPU */ /* Need to know about CPUs going up/down? */ -int register_cpu_notifier(struct notifier_block *nb) +int __cpuinit register_cpu_notifier(struct notifier_block *nb) { return blocking_notifier_chain_register(&cpu_chain, nb); } + +#ifdef CONFIG_HOTPLUG_CPU + EXPORT_SYMBOL(register_cpu_notifier); void unregister_cpu_notifier(struct notifier_block *nb) @@ -81,7 +84,6 @@ void unregister_cpu_notifier(struct noti } EXPORT_SYMBOL(unregister_cpu_notifier); -#ifdef CONFIG_HOTPLUG_CPU static inline void check_for_tasks(int cpu) { struct task_struct *p; _ Patches currently in -mm which might be from sekharan@xxxxxxxxxx are origin.patch per-task-delay-accounting-cpu-delay-collection-via-schedstats.patch task-watchers-task-watchers.patch task-watchers-task-watchers-tidy.patch task-watchers-register-per-task-delay-accounting.patch task-watchers-add-support-for-per-task-watchers.patch task-watchers-add-support-for-per-task-watchers-warning-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html