Commit 91eaed0d authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/topology: Simplify build_overlap_sched_groups()

Now that the first group will always be the previous domain of this
@cpu this can be simplified.

In fact, writing the code now removed should've been a big clue I was
doing it wrong :/
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0372dd27
...@@ -557,7 +557,7 @@ static void init_overlap_sched_group(struct sched_domain *sd, ...@@ -557,7 +557,7 @@ static void init_overlap_sched_group(struct sched_domain *sd,
static int static int
build_overlap_sched_groups(struct sched_domain *sd, int cpu) build_overlap_sched_groups(struct sched_domain *sd, int cpu)
{ {
struct sched_group *first = NULL, *last = NULL, *groups = NULL, *sg; struct sched_group *first = NULL, *last = NULL, *sg;
const struct cpumask *span = sched_domain_span(sd); const struct cpumask *span = sched_domain_span(sd);
struct cpumask *covered = sched_domains_tmpmask; struct cpumask *covered = sched_domains_tmpmask;
struct sd_data *sdd = sd->private; struct sd_data *sdd = sd->private;
...@@ -587,15 +587,6 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu) ...@@ -587,15 +587,6 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)
init_overlap_sched_group(sd, sg, i); init_overlap_sched_group(sd, sg, i);
/*
* Make sure the first group of this domain contains the
* canonical balance CPU. Otherwise the sched_domain iteration
* breaks. See update_sg_lb_stats().
*/
if ((!groups && cpumask_test_cpu(cpu, sg_span)) ||
group_balance_cpu(sg) == cpu)
groups = sg;
if (!first) if (!first)
first = sg; first = sg;
if (last) if (last)
...@@ -603,7 +594,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu) ...@@ -603,7 +594,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)
last = sg; last = sg;
last->next = first; last->next = first;
} }
sd->groups = groups; sd->groups = first;
return 0; return 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