]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched: lock cpu_attach_domain for hotplug
authorAndrew Morton <akpm@osdl.org>
Mon, 10 May 2004 06:28:35 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 10 May 2004 06:28:35 +0000 (23:28 -0700)
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.

kernel/sched.c

index 7bf07d5942e06aff53fe7854760ed639e1a3fd26..89180b65488db9b080ead1a056c578f8ff0eca11 100644 (file)
@@ -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