Commit 6dfdb062 authored by Gautham R Shenoy's avatar Gautham R Shenoy Committed by Ingo Molnar

sched: Fix indentations in find_busiest_group() using gotos

Impact: cleanup

Some indentations in find_busiest_group() can minimized by using
early exits with the help of gotos. This improves readability in
a couple of cases.
Signed-off-by: default avatarGautham R Shenoy <ego@in.ibm.com>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Balbir Singh" <balbir@in.ibm.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Dhaval Giani" <dhaval@linux.vnet.ibm.com>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: "Vaidyanathan Srinivasan" <svaidy@linux.vnet.ibm.com>
LKML-Reference: <20090325091340.13992.45062.stgit@sofia.in.ibm.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 67bb6c03
...@@ -3403,15 +3403,15 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, ...@@ -3403,15 +3403,15 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
* capacity but still has some space to pick up some load * capacity but still has some space to pick up some load
* from other group and save more power * from other group and save more power
*/ */
if (sum_nr_running <= group_capacity - 1) { if (sum_nr_running > group_capacity - 1)
goto group_next;
if (sum_nr_running > leader_nr_running || if (sum_nr_running > leader_nr_running ||
(sum_nr_running == leader_nr_running && (sum_nr_running == leader_nr_running &&
group_first_cpu(group) < group_first_cpu(group) < group_first_cpu(group_leader))) {
group_first_cpu(group_leader))) {
group_leader = group; group_leader = group;
leader_nr_running = sum_nr_running; leader_nr_running = sum_nr_running;
} }
}
group_next: group_next:
#endif #endif
group = group->next; group = group->next;
...@@ -3531,14 +3531,16 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, ...@@ -3531,14 +3531,16 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
if (idle == CPU_NOT_IDLE || !(sd->flags & SD_POWERSAVINGS_BALANCE)) if (idle == CPU_NOT_IDLE || !(sd->flags & SD_POWERSAVINGS_BALANCE))
goto ret; goto ret;
if (this == group_leader && group_leader != group_min) { if (this != group_leader || group_leader == group_min)
goto ret;
*imbalance = min_load_per_task; *imbalance = min_load_per_task;
if (sched_mc_power_savings >= POWERSAVINGS_BALANCE_WAKEUP) { if (sched_mc_power_savings >= POWERSAVINGS_BALANCE_WAKEUP) {
cpu_rq(this_cpu)->rd->sched_mc_preferred_wakeup_cpu = cpu_rq(this_cpu)->rd->sched_mc_preferred_wakeup_cpu =
group_first_cpu(group_leader); group_first_cpu(group_leader);
} }
return group_min; return group_min;
}
#endif #endif
ret: ret:
*imbalance = 0; *imbalance = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment