sched: for 0day robot: don't abuse cpu_active()
PATCH 1/1 sched: for 0day robot: don't abuse cpu_active()
Quoted 8 lines · Peter Zijlstra
Quoted 2 lines · Oleg Nesterov
Yes, because that damn
cpu_active()check doesn't look strictly necessary ;) Or I misunderstood.How about we sit down and have a hard look after Thomas is done revamping hotplug? I don't want to go pour over hotplug code that is guaranteed to change.
OK, understand.
But I have an idea ;) It seems that the Fengguang's robot is more clever than me. Let me change the subject and add s-o-b to seduce it to test this change.
Once again, I agree, lets forget this change for now. But if I missed something and we can't do this, perhaps the robot will explain why.
Signed-off-by Oleg Nesterov <[email protected]>
--- arch/powerpc/kernel/smp.c | 2 +- arch/s390/kernel/smp.c | 2 +- kernel/sched/core.c | 12 ------------ 3 files changed, 2 insertions(+), 14 deletions(-)
kernel/sched/core.c +0 -12
@@ -1557,8 +1557,6 @@ static int select_fallback_rq(int cpu, sfor_each_cpu (dest_cpu, nodemask) {if (!cpu_online (dest_cpu))continue ; -if (!cpu_active (dest_cpu)) -continue ;if (cpumask_test_cpu (dest_cpu,tsk_cpus_allowed (p)))return dest_cpu; }
@@ -1569,8 +1567,6 @@ static int select_fallback_rq(int cpu, sfor_each_cpu (dest_cpu,tsk_cpus_allowed (p)) {if (!cpu_online (dest_cpu))continue ; -if (!cpu_active (dest_cpu)) -continue ; goto out; }
@@ -5519,14 +5515,6 @@ static int sched_cpu_active(struct notifcase CPU_STARTING :set_cpu_rq_start_time ();return NOTIFY_OK ; -case CPU_ONLINE : -/* -* At this point a starting CPU has marked itself as online via -* set_cpu_online(). But it might not yet have marked itself -* as active, which is essential from here on. -* -* Thus, fall-through and help the starting CPU along. -*/ case CPU_DOWN_FAILED :set_cpu_active ((long )hcpu, true);return NOTIFY_OK ;
arch/powerpc/kernel/smp.c +1 -1
@@ -542,7 +542,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) smp_ops->give_timebase ();/* Wait until cpu puts itself in the online & active maps */ -while (!cpu_online (cpu) || !cpu_active (cpu)) +while (!cpu_online (cpu))cpu_relax ();return 0 ;
arch/s390/kernel/smp.c +1 -1
@@ -819,7 +819,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)pcpu_attach_task (pcpu, tidle);pcpu_start_fn (pcpu, smp_start_secondary,NULL );/* Wait until cpu puts itself in the online & active maps */ -while (!cpu_online (cpu) || !cpu_active (cpu)) +while (!cpu_online (cpu))cpu_relax ();return 0 ; }