aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-09 23:28:35 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-09 23:28:35 -0700
commit2ce2e329ddad1da9b86eb159a6c54a57850855d5 (patch)
tree3f788ce602197554c522082ad44b56b26360e2d2 /kernel
parent7dc127021abbd45d928fafdcd57422d689e18be5 (diff)
downloadhistory-2ce2e329ddad1da9b86eb159a6c54a57850855d5.tar.gz
[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.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 7bf07d5942e06a..89180b65488db9 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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