aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 47fff3b63cbf..79e40f00dcb8 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -269,8 +269,11 @@ out_release:
269 269
270int __ref cpu_down(unsigned int cpu) 270int __ref cpu_down(unsigned int cpu)
271{ 271{
272 int err = 0; 272 int err;
273 273
274 err = stop_machine_create();
275 if (err)
276 return err;
274 cpu_maps_update_begin(); 277 cpu_maps_update_begin();
275 278
276 if (cpu_hotplug_disabled) { 279 if (cpu_hotplug_disabled) {
@@ -297,6 +300,7 @@ int __ref cpu_down(unsigned int cpu)
297 300
298out: 301out:
299 cpu_maps_update_done(); 302 cpu_maps_update_done();
303 stop_machine_destroy();
300 return err; 304 return err;
301} 305}
302EXPORT_SYMBOL(cpu_down); 306EXPORT_SYMBOL(cpu_down);
@@ -375,8 +379,11 @@ static cpumask_var_t frozen_cpus;
375 379
376int disable_nonboot_cpus(void) 380int disable_nonboot_cpus(void)
377{ 381{
378 int cpu, first_cpu, error = 0; 382 int cpu, first_cpu, error;
379 383
384 error = stop_machine_create();
385 if (error)
386 return error;
380 cpu_maps_update_begin(); 387 cpu_maps_update_begin();
381 first_cpu = cpumask_first(cpu_online_mask); 388 first_cpu = cpumask_first(cpu_online_mask);
382 /* We take down all of the non-boot CPUs in one shot to avoid races 389 /* We take down all of the non-boot CPUs in one shot to avoid races
@@ -405,6 +412,7 @@ int disable_nonboot_cpus(void)
405 printk(KERN_ERR "Non-boot CPUs are not disabled\n"); 412 printk(KERN_ERR "Non-boot CPUs are not disabled\n");
406 } 413 }
407 cpu_maps_update_done(); 414 cpu_maps_update_done();
415 stop_machine_destroy();
408 return error; 416 return error;
409} 417}
410 418