Commit 2ce2e329 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sched: lock cpu_attach_domain for hotplug

From: Nick Piggin <nickpiggin@yahoo.com.au>

The attached patch is required to work correctly with the CPU hotplug
framework.  John Hawkes reports successful booting with this.
parent 7dc12702
......@@ -3457,6 +3457,8 @@ void cpu_attach_domain(struct sched_domain *sd, int cpu)
runqueue_t *rq = cpu_rq(cpu);
int local = 1;
lock_cpu_hotplug();
spin_lock_irqsave(&rq->lock, flags);
if (cpu == smp_processor_id() || cpu_is_offline(cpu)) {
......@@ -3475,6 +3477,8 @@ void cpu_attach_domain(struct sched_domain *sd, int cpu)
wake_up_process(rq->migration_thread);
wait_for_completion(&req.done);
}
unlock_cpu_hotplug();
}
#ifdef ARCH_HAS_SCHED_DOMAIN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment