[PATCH] cpu hotplug: use hotplug version of cpu notifier in appropriate places
Make use the of newly defined hotplug version of cpu_notifier functionality wherever appropriate. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Cc: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
39f4885c56
commit
5a67e4c5b6
@@ -673,9 +673,7 @@ salinfo_init(void)
|
|||||||
salinfo_timer.function = &salinfo_timeout;
|
salinfo_timer.function = &salinfo_timeout;
|
||||||
add_timer(&salinfo_timer);
|
add_timer(&salinfo_timer);
|
||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
register_hotcpu_notifier(&salinfo_cpu_notifier);
|
||||||
register_cpu_notifier(&salinfo_cpu_notifier);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -3541,9 +3541,7 @@ int __init blk_dev_init(void)
|
|||||||
INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
|
INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
|
||||||
|
|
||||||
open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);
|
open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
register_hotcpu_notifier(&blk_cpu_notifier);
|
||||||
register_cpu_notifier(&blk_cpu_notifier);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
blk_max_low_pfn = max_low_pfn;
|
blk_max_low_pfn = max_low_pfn;
|
||||||
blk_max_pfn = max_pfn;
|
blk_max_pfn = max_pfn;
|
||||||
|
@@ -1721,15 +1721,14 @@ xfs_mount_log_sbunit(
|
|||||||
* is present to prevent thrashing).
|
* is present to prevent thrashing).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
/*
|
/*
|
||||||
* hot-plug CPU notifier support.
|
* hot-plug CPU notifier support.
|
||||||
*
|
*
|
||||||
* We cannot use the hotcpu_register() function because it does
|
* We need a notifier per filesystem as we need to be able to identify
|
||||||
* not allow notifier instances. We need a notifier per filesystem
|
* the filesystem to balance the counters out. This is achieved by
|
||||||
* as we need to be able to identify the filesystem to balance
|
* having a notifier block embedded in the xfs_mount_t and doing pointer
|
||||||
* the counters out. This is achieved by having a notifier block
|
* magic to get the mount pointer from the notifier block address.
|
||||||
* embedded in the xfs_mount_t and doing pointer magic to get the
|
|
||||||
* mount pointer from the notifier block address.
|
|
||||||
*/
|
*/
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_icsb_cpu_notify(
|
xfs_icsb_cpu_notify(
|
||||||
@@ -1779,6 +1778,7 @@ xfs_icsb_cpu_notify(
|
|||||||
|
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_HOTPLUG_CPU */
|
||||||
|
|
||||||
int
|
int
|
||||||
xfs_icsb_init_counters(
|
xfs_icsb_init_counters(
|
||||||
@@ -1791,9 +1791,11 @@ xfs_icsb_init_counters(
|
|||||||
if (mp->m_sb_cnts == NULL)
|
if (mp->m_sb_cnts == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify;
|
mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify;
|
||||||
mp->m_icsb_notifier.priority = 0;
|
mp->m_icsb_notifier.priority = 0;
|
||||||
register_cpu_notifier(&mp->m_icsb_notifier);
|
register_hotcpu_notifier(&mp->m_icsb_notifier);
|
||||||
|
#endif /* CONFIG_HOTPLUG_CPU */
|
||||||
|
|
||||||
for_each_online_cpu(i) {
|
for_each_online_cpu(i) {
|
||||||
cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i);
|
cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i);
|
||||||
@@ -1812,7 +1814,7 @@ xfs_icsb_destroy_counters(
|
|||||||
xfs_mount_t *mp)
|
xfs_mount_t *mp)
|
||||||
{
|
{
|
||||||
if (mp->m_sb_cnts) {
|
if (mp->m_sb_cnts) {
|
||||||
unregister_cpu_notifier(&mp->m_icsb_notifier);
|
unregister_hotcpu_notifier(&mp->m_icsb_notifier);
|
||||||
free_percpu(mp->m_sb_cnts);
|
free_percpu(mp->m_sb_cnts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user