Skip to content

Commit 3676b13

Browse files
msrasmussenIngo Molnar
authored andcommitted
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: Morten Rasmussen <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 1f6e6c7 commit 3676b13

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/sched/core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6381,7 +6381,8 @@ static int sched_domains_curr_level;
63816381
SD_SHARE_POWERDOMAIN)
63826382

63836383
static struct sched_domain *
6384-
sd_init(struct sched_domain_topology_level *tl, int cpu)
6384+
sd_init(struct sched_domain_topology_level *tl,
6385+
struct sched_domain *child, int cpu)
63856386
{
63866387
struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu);
63876388
int sd_weight, sd_flags = 0;
@@ -6433,6 +6434,7 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
64336434
.smt_gain = 0,
64346435
.max_newidle_lb_cost = 0,
64356436
.next_decay_max_lb_cost = jiffies,
6437+
.child = child,
64366438
#ifdef CONFIG_SCHED_DEBUG
64376439
.name = tl->name,
64386440
#endif
@@ -6857,14 +6859,13 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
68576859
const struct cpumask *cpu_map, struct sched_domain_attr *attr,
68586860
struct sched_domain *child, int cpu)
68596861
{
6860-
struct sched_domain *sd = sd_init(tl, cpu);
6862+
struct sched_domain *sd = sd_init(tl, child, cpu);
68616863

68626864
cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
68636865
if (child) {
68646866
sd->level = child->level + 1;
68656867
sched_domain_level_max = max(sched_domain_level_max, sd->level);
68666868
child->parent = sd;
6867-
sd->child = child;
68686869

68696870
if (!cpumask_subset(sched_domain_span(child),
68706871
sched_domain_span(sd))) {

0 commit comments

Comments
 (0)