提交 26ff6ad9 编写于 作者: S Srivatsa Vaddagiri 提交者: Linus Torvalds

[PATCH] CPU hotplug breaks wake_up_new_task

Fix a problem wherein a new-born task is added to a dead CPU.
Signed-off-by: NSrivatsa Vaddagiri <vatsa@in.ibm.com>
Acked-by: NNick Piggin <nickpiggin@yahoo.com.au>
Acked-by: NShaohua Li <shaohua.li@intel.com>
Acked-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fa72e26a
...@@ -1062,7 +1062,8 @@ static task_t *copy_process(unsigned long clone_flags, ...@@ -1062,7 +1062,8 @@ static task_t *copy_process(unsigned long clone_flags,
* parent's CPU). This avoids alot of nasty races. * parent's CPU). This avoids alot of nasty races.
*/ */
p->cpus_allowed = current->cpus_allowed; p->cpus_allowed = current->cpus_allowed;
if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed))) if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) ||
!cpu_online(task_cpu(p))))
set_task_cpu(p, smp_processor_id()); set_task_cpu(p, smp_processor_id());
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册