diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2013-11-07 02:06:07 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:20:02 (GMT) |
commit | 6578bd13c3ad979c777eafef6e8efd4e18578e94 (patch) | |
tree | eb95dbc753ed91a39120a01e7d3f6d5ceceafe7b | |
parent | 0248964081706167e31bd9da7912f3f24462751f (diff) | |
download | linux-fsl-qoriq-6578bd13c3ad979c777eafef6e8efd4e18578e94.tar.xz |
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.
Cc: stable-rt@vger.kernel.org
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 868bfd4..ba7416b 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -601,6 +601,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) err = -EBUSY; goto restore_cpus; } + migrate_enable(); cpu_hotplug_begin(); err = cpu_unplug_begin(cpu); @@ -654,7 +655,6 @@ static int __ref _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); |