sched/core: Fix a race between try_to_wake_up() and a woken up task
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / cpu.c
index 198a38883e64a0616437401ef2692f5b3c9029a5..bc255e25d5ddced3bcda1cca7f2d61ba3e7c6cac 100644 (file)
@@ -698,10 +698,12 @@ void set_cpu_present(unsigned int cpu, bool present)
 
 void set_cpu_online(unsigned int cpu, bool online)
 {
-       if (online)
+       if (online) {
                cpumask_set_cpu(cpu, to_cpumask(cpu_online_bits));
-       else
+               cpumask_set_cpu(cpu, to_cpumask(cpu_active_bits));
+       } else {
                cpumask_clear_cpu(cpu, to_cpumask(cpu_online_bits));
+       }
 }
 
 void set_cpu_active(unsigned int cpu, bool active)