Revert "ARM64: sched: fix bug: avoid infinite loop"
authorHuang, Tao <huangtao@rock-chips.com>
Fri, 4 Nov 2016 06:06:58 +0000 (14:06 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 4 Nov 2016 06:12:09 +0000 (14:12 +0800)
This reverts commit d4773e1407b6d59a202bd4ce8acc83deaceafa29.

Fixed by commit abdb60d816bfd20b8d4f61c3e7c95a61ad12212a
("FIXUP: sched/fair: Fix hang during suspend in sched_group_energy")

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
kernel/sched/fair.c

index c51be77..3217494 100644 (file)
@@ -4883,7 +4883,6 @@ static int sched_group_energy(struct energy_env *eenv)
                struct sched_group *sg_shared_cap = NULL;
 
                cpu = cpumask_first(&visit_cpus);
-               cpumask_clear_cpu(cpu, &visit_cpus);
 
                /*
                 * Is the group utilization affected by cpus outside this
@@ -4946,12 +4945,8 @@ static int sched_group_energy(struct energy_env *eenv)
 
                                total_energy += sg_busy_energy + sg_idle_energy;
 
-                               if (!sd->child) {
-                                       int i;
-
-                                       for_each_cpu(i, sched_group_cpus(sg))
-                                               cpumask_clear_cpu(i, &visit_cpus);
-                               }
+                               if (!sd->child)
+                                       cpumask_xor(&visit_cpus, &visit_cpus, sched_group_cpus(sg));
 
                                if (cpumask_equal(sched_group_cpus(sg), sched_group_cpus(eenv->sg_top)))
                                        goto next_cpu;