Blob Blame History Raw
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 17 Jul 2011 19:35:29 +0200
Subject: hotplug: Use migrate disable on unplug
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
Git-commit: df1e82500a5cf484440be47db0cd0f16ffb09ce6
Patch-mainline: Queued in subsystem maintainer repository
References: SLE Realtime Extension

Migration needs to be disabled accross the unplug handling to make
sure that the unplug thread is off the unplugged cpu.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
---
 kernel/cpu.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -890,14 +890,13 @@ static int __ref _cpu_down(unsigned int
 	cpumask_andnot(cpumask, cpu_online_mask, cpumask_of(cpu));
 	set_cpus_allowed_ptr(current, cpumask);
 	free_cpumask_var(cpumask);
-	preempt_disable();
+	migrate_disable();
 	mycpu = smp_processor_id();
 	if (mycpu == cpu) {
 		printk(KERN_ERR "Yuck! Still on unplug CPU\n!");
-		preempt_enable();
+		migrate_enable();
 		return -EBUSY;
 	}
-	preempt_enable();
 
 	cpu_hotplug_begin();
 	ret = cpu_unplug_begin(cpu);
@@ -945,6 +944,7 @@ static int __ref _cpu_down(unsigned int
 	cpu_unplug_done(cpu);
 out_cancel:
 	cpu_hotplug_done();
+	migrate_enable();
 	return ret;
 }