aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/stop_machine.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-14 20:37:02 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-14 20:37:02 +0100
commit7f01473211b2586130c653d3b1ac15acc082d4df (patch)
tree48cda4464ba8a8ff424e5c3d7dd9d0aa3a9fa9c3 /xen/common/stop_machine.c
parentf9ffb1134c8be2f6bffd14578c179d3f12371abd (diff)
downloadxen-7f01473211b2586130c653d3b1ac15acc082d4df.tar.gz
xen-7f01473211b2586130c653d3b1ac15acc082d4df.tar.bz2
xen-7f01473211b2586130c653d3b1ac15acc082d4df.zip
Remove many uses of cpu_possible_map and iterators over NR_CPUS.
The significant remaining culprits for x86 are credit2, hpet, and percpu-area subsystems. To be dealt with in a separate patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/stop_machine.c')
-rw-r--r--xen/common/stop_machine.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c
index 83f525f09b..31d5c6fff7 100644
--- a/xen/common/stop_machine.c
+++ b/xen/common/stop_machine.c
@@ -155,12 +155,31 @@ static void stopmachine_action(unsigned long cpu)
local_irq_enable();
}
-static int __init cpu_stopmachine_init(void)
+static int cpu_callback(
+ struct notifier_block *nfb, unsigned long action, void *hcpu)
{
- unsigned int cpu;
- for_each_possible_cpu ( cpu )
+ unsigned int cpu = (unsigned long)hcpu;
+
+ if ( action == CPU_UP_PREPARE )
tasklet_init(&per_cpu(stopmachine_tasklet, cpu),
stopmachine_action, cpu);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+ .notifier_call = cpu_callback
+};
+
+static int __init cpu_stopmachine_init(void)
+{
+ unsigned int cpu;
+ for_each_online_cpu ( cpu )
+ {
+ void *hcpu = (void *)(long)cpu;
+ cpu_callback(&cpu_nfb, CPU_UP_PREPARE, hcpu);
+ }
+ register_cpu_notifier(&cpu_nfb);
return 0;
}
__initcall(cpu_stopmachine_init);