Commit 3676b13e authored by Morten Rasmussen's avatar Morten Rasmussen Committed by Ingo Molnar

sched/core: Pass child domain into sd_init()

If behavioural sched_domain flags depend on topology flags set at higher
domain levels we need a way to update the child domain flags. Moving the
child pointer assignment inside sd_init() should make that possible.
Signed-off-by: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
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: dietmar.eggemann@arm.com
Cc: freedom.tan@mediatek.com
Cc: keita.kobayashi.ym@renesas.com
Cc: mgalbraith@suse.de
Cc: sgurrappadi@nvidia.com
Cc: vincent.guittot@linaro.org
Cc: yuyang.du@intel.com
Link: http://lkml.kernel.org/r/1469453670-2660-7-git-send-email-morten.rasmussen@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 1f6e6c7c
...@@ -6381,7 +6381,8 @@ static int sched_domains_curr_level; ...@@ -6381,7 +6381,8 @@ static int sched_domains_curr_level;
SD_SHARE_POWERDOMAIN) SD_SHARE_POWERDOMAIN)
static struct sched_domain * static struct sched_domain *
sd_init(struct sched_domain_topology_level *tl, int cpu) sd_init(struct sched_domain_topology_level *tl,
struct sched_domain *child, int cpu)
{ {
struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu); struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu);
int sd_weight, sd_flags = 0; int sd_weight, sd_flags = 0;
...@@ -6433,6 +6434,7 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) ...@@ -6433,6 +6434,7 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
.smt_gain = 0, .smt_gain = 0,
.max_newidle_lb_cost = 0, .max_newidle_lb_cost = 0,
.next_decay_max_lb_cost = jiffies, .next_decay_max_lb_cost = jiffies,
.child = child,
#ifdef CONFIG_SCHED_DEBUG #ifdef CONFIG_SCHED_DEBUG
.name = tl->name, .name = tl->name,
#endif #endif
...@@ -6857,14 +6859,13 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl, ...@@ -6857,14 +6859,13 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
const struct cpumask *cpu_map, struct sched_domain_attr *attr, const struct cpumask *cpu_map, struct sched_domain_attr *attr,
struct sched_domain *child, int cpu) struct sched_domain *child, int cpu)
{ {
struct sched_domain *sd = sd_init(tl, cpu); struct sched_domain *sd = sd_init(tl, child, cpu);
cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu)); cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
if (child) { if (child) {
sd->level = child->level + 1; sd->level = child->level + 1;
sched_domain_level_max = max(sched_domain_level_max, sd->level); sched_domain_level_max = max(sched_domain_level_max, sd->level);
child->parent = sd; child->parent = sd;
sd->child = child;
if (!cpumask_subset(sched_domain_span(child), if (!cpumask_subset(sched_domain_span(child),
sched_domain_span(sd))) { sched_domain_span(sd))) {
......
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