diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2013-11-07 10:06:07 +0800 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2016-02-13 00:36:31 +0100 |
commit | ed73e71f7c027d7d0736d531863922e4070c4d1c (patch) | |
tree | a5f5b3b98fa607bc9ef339b4de38303f4605bf8e | |
parent | fa055a4b3adff2994ad1c637d9f88876b487a62d (diff) | |
download | rt-linux-ed73e71f7c027d7d0736d531863922e4070c4d1c.tar.gz |
cpu_down: move migrate_enable() back
Commit 08c1ab68, "hotplug-use-migrate-disable.patch", intends to
use migrate_enable()/migrate_disable() to replace that combination
of preempt_enable() and preempt_disable(), but actually in
!CONFIG_PREEMPT_RT_FULL case, migrate_enable()/migrate_disable()
are still equal to preempt_enable()/preempt_disable(). So that
followed cpu_hotplug_begin()/cpu_unplug_begin(cpu) would go schedule()
to trigger schedule_debug() like this:
_cpu_down()
|
+ migrate_disable() = preempt_disable()
|
+ cpu_hotplug_begin() or cpu_unplug_begin()
|
+ schedule()
|
+ __schedule()
|
+ preempt_disable();
|
+ __schedule_bug() is true!
So we should move migrate_enable() as the original scheme.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
-rw-r--r-- | kernel/cpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 7e12e6bb219ac4..a7dc11f6f75ee9 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -657,6 +657,7 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen) err = -EBUSY; goto restore_cpus; } + migrate_enable(); cpu_hotplug_begin(); err = cpu_unplug_begin(cpu); @@ -741,7 +742,6 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen) out_release: cpu_unplug_done(cpu); out_cancel: - migrate_enable(); cpu_hotplug_done(); if (!err) cpu_notify_nofail(CPU_POST_DEAD | mod, hcpu); |