From 2ce2e329ddad1da9b86eb159a6c54a57850855d5 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 9 May 2004 23:28:35 -0700 Subject: [PATCH] [PATCH] sched: lock cpu_attach_domain for hotplug From: Nick Piggin The attached patch is required to work correctly with the CPU hotplug framework. John Hawkes reports successful booting with this. --- kernel/sched.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched.c b/kernel/sched.c index 7bf07d5942e06..89180b65488db 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 -- 2.53.0