mirror of
https://github.com/torvalds/linux
synced 2024-09-20 02:57:25 +00:00
[PATCH] cpu-hotplug: release `workqueue_mutex' properly on CPU hot-remove
_cpu_down() acquires `workqueue_mutex' on its process, but doen't release it if __cpu_disable() fails. Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
bb1d860551
commit
8fa1d7d3b2
12
kernel/cpu.c
12
kernel/cpu.c
|
@ -150,18 +150,18 @@ static int _cpu_down(unsigned int cpu)
|
||||||
p = __stop_machine_run(take_cpu_down, NULL, cpu);
|
p = __stop_machine_run(take_cpu_down, NULL, cpu);
|
||||||
mutex_unlock(&cpu_bitmask_lock);
|
mutex_unlock(&cpu_bitmask_lock);
|
||||||
|
|
||||||
if (IS_ERR(p)) {
|
if (IS_ERR(p) || cpu_online(cpu)) {
|
||||||
/* CPU didn't die: tell everyone. Can't complain. */
|
/* CPU didn't die: tell everyone. Can't complain. */
|
||||||
if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
|
if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
|
||||||
(void *)(long)cpu) == NOTIFY_BAD)
|
(void *)(long)cpu) == NOTIFY_BAD)
|
||||||
BUG();
|
BUG();
|
||||||
|
|
||||||
err = PTR_ERR(p);
|
if (IS_ERR(p)) {
|
||||||
goto out_allowed;
|
err = PTR_ERR(p);
|
||||||
}
|
goto out_allowed;
|
||||||
|
}
|
||||||
if (cpu_online(cpu))
|
|
||||||
goto out_thread;
|
goto out_thread;
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait for it to sleep (leaving idle task). */
|
/* Wait for it to sleep (leaving idle task). */
|
||||||
while (!idle_cpu(cpu))
|
while (!idle_cpu(cpu))
|
||||||
|
|
Loading…
Reference in a new issue