Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178026
b: refs/heads/master
c: 9ee349a
h: refs/heads/master
v: v3
  • Loading branch information
Xiaotian Feng authored and Ingo Molnar committed Dec 16, 2009
1 parent e1f76c2 commit 66599c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 933b0618d8b2a59c7a0742e43836544e02f1e9bd
refs/heads/master: 9ee349ad6d326df3633d43f54202427295999c47
24 changes: 3 additions & 21 deletions trunk/kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
return -ENOMEM;

cpu_hotplug_begin();
set_cpu_active(cpu, false);
err = __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE | mod,
hcpu, -1, &nr_calls);
if (err == NOTIFY_BAD) {
Expand Down Expand Up @@ -280,18 +281,6 @@ int __ref cpu_down(unsigned int cpu)
goto out;
}

set_cpu_active(cpu, false);

/*
* Make sure the all cpus did the reschedule and are not
* using stale version of the cpu_active_mask.
* This is not strictly necessary becuase stop_machine()
* that we run down the line already provides the required
* synchronization. But it's really a side effect and we do not
* want to depend on the innards of the stop_machine here.
*/
synchronize_sched();

err = _cpu_down(cpu, 0);

out:
Expand Down Expand Up @@ -382,19 +371,12 @@ int disable_nonboot_cpus(void)
return error;
cpu_maps_update_begin();
first_cpu = cpumask_first(cpu_online_mask);
/* We take down all of the non-boot CPUs in one shot to avoid races
/*
* We take down all of the non-boot CPUs in one shot to avoid races
* with the userspace trying to use the CPU hotplug at the same time
*/
cpumask_clear(frozen_cpus);

for_each_online_cpu(cpu) {
if (cpu == first_cpu)
continue;
set_cpu_active(cpu, false);
}

synchronize_sched();

printk("Disabling non-boot CPUs ...\n");
for_each_online_cpu(cpu) {
if (cpu == first_cpu)
Expand Down

0 comments on commit 66599c8

Please sign in to comment.