Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245562
b: refs/heads/master
c: eb7a74e
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 11, 2011
1 parent 9fa8811 commit 5e14013
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3081f52f29da1ba6c27685519a9222b39eac763
refs/heads/master: eb7a74e6cd936c00749e2921b9e058631d986648
32 changes: 26 additions & 6 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6843,6 +6843,16 @@ enum s_alloc {
sa_none,
};

typedef struct sched_domain *(*sched_domain_build_f)(struct s_data *d,
const struct cpumask *cpu_map, struct sched_domain_attr *attr,
struct sched_domain *parent, int cpu);

typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);

struct sched_domain_topology_level {
sched_domain_build_f build;
};

/*
* Assumes the sched_domain tree is fully constructed
*/
Expand Down Expand Up @@ -7185,6 +7195,18 @@ static struct sched_domain *__build_smt_sched_domain(struct s_data *d,
return sd;
}

static struct sched_domain_topology_level default_topology[] = {
{ __build_allnodes_sched_domain, },
{ __build_node_sched_domain, },
{ __build_cpu_sched_domain, },
{ __build_book_sched_domain, },
{ __build_mc_sched_domain, },
{ __build_smt_sched_domain, },
{ NULL, },
};

static struct sched_domain_topology_level *sched_domain_topology = default_topology;

/*
* Build sched domains for a given set of cpus and attach the sched domains
* to the individual cpus
Expand All @@ -7203,13 +7225,11 @@ static int build_sched_domains(const struct cpumask *cpu_map,

/* Set up domains for cpus specified by the cpu_map. */
for_each_cpu(i, cpu_map) {
struct sched_domain_topology_level *tl;

sd = NULL;
sd = __build_allnodes_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_node_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_cpu_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_book_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_mc_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_smt_sched_domain(&d, cpu_map, attr, sd, i);
for (tl = sched_domain_topology; tl->build; tl++)
sd = tl->build(&d, cpu_map, attr, sd, i);

*per_cpu_ptr(d.sd, i) = sd;
}
Expand Down

0 comments on commit 5e14013

Please sign in to comment.