From: Srivatsa Vaddagiri Date: Sat, 17 Sep 2005 02:27:40 +0000 (-0700) Subject: [PATCH] CPU hotplug breaks wake_up_new_task X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26ff6ad9786abf6f40a6d3cbb89753b4fa50cb00;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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: Srivatsa Vaddagiri Acked-by: Nick Piggin Acked-by: Shaohua Li Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index 8149f3602881..533ce27f4b2c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1062,7 +1062,8 @@ static task_t *copy_process(unsigned long clone_flags, * parent's CPU). This avoids alot of nasty races. */ 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()); /*