blob: cef810d7d7db79db7ec580c8d505c504b1e66821 [file] [log] [blame]
Arvind M8e87d852018-01-29 00:04:29 -08001From 6e58d6c97bc8a170f5f3fb35954a765623f3817c Mon Sep 17 00:00:00 2001
Allen Martin685e0f82016-07-26 19:34:29 -07002From: Thomas Gleixner <tglx@linutronix.de>
3Date: Sun, 17 Jul 2011 19:35:29 +0200
Arvind M10268e72017-12-04 22:18:06 -08004Subject: [PATCH 105/366] hotplug: Use migrate disable on unplug
Allen Martin685e0f82016-07-26 19:34:29 -07005
6Migration needs to be disabled accross the unplug handling to make
7sure that the unplug thread is off the unplugged cpu.
8
9Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Allen Martin685e0f82016-07-26 19:34:29 -070010---
11 kernel/cpu.c | 6 +++---
12 1 file changed, 3 insertions(+), 3 deletions(-)
13
14diff --git a/kernel/cpu.c b/kernel/cpu.c
Ishan Mittalb7998262017-01-17 16:11:50 +053015index 04df252..494b606 100644
Allen Martin685e0f82016-07-26 19:34:29 -070016--- a/kernel/cpu.c
17+++ b/kernel/cpu.c
18@@ -457,14 +457,13 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
19 cpumask_andnot(cpumask, cpu_online_mask, cpumask_of(cpu));
20 set_cpus_allowed_ptr(current, cpumask);
21 free_cpumask_var(cpumask);
22- preempt_disable();
23+ migrate_disable();
24 mycpu = smp_processor_id();
25 if (mycpu == cpu) {
26 printk(KERN_ERR "Yuck! Still on unplug CPU\n!");
27- preempt_enable();
28+ migrate_enable();
29 return -EBUSY;
30 }
31- preempt_enable();
32
33 cpu_hotplug_begin();
34 err = cpu_unplug_begin(cpu);
Ishan Mittalb7998262017-01-17 16:11:50 +053035@@ -546,6 +545,7 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
Allen Martin685e0f82016-07-26 19:34:29 -070036 out_release:
37 cpu_unplug_done(cpu);
38 out_cancel:
39+ migrate_enable();
40 cpu_hotplug_done();
41 trace_sched_cpu_hotplug(cpu, err, 0);
42 if (!err)
43--
Arvind M10268e72017-12-04 22:18:06 -0800441.9.1
Allen Martin685e0f82016-07-26 19:34:29 -070045