Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38019
b: refs/heads/master
c: 1a84887
h: refs/heads/master
i:
  38017: b42ec85
  38015: c46ec45
v: v3
  • Loading branch information
Siddha, Suresh B authored and Linus Torvalds committed Oct 3, 2006
1 parent 26a9e3c commit d3ed709
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 11 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: 74732646431a1bb7e23e6b564127a8881cfef900
refs/heads/master: 1a84887080dc15f048db7c3a643e98f1435790d6
1 change: 1 addition & 0 deletions trunk/include/asm-i386/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static inline int node_to_first_cpu(int node)
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 8, \
.max_interval = 32, \
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-ia64/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void build_cpu_to_node_map(void);
#define SD_CPU_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 1, \
.max_interval = 4, \
Expand All @@ -84,6 +85,7 @@ void build_cpu_to_node_map(void);
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 8, \
.max_interval = 8*(min(num_online_cpus(), 32)), \
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-mips/mach-ip27/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 8, \
.max_interval = 32, \
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extern int pcibus_to_node(struct pci_bus *bus);
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 8, \
.max_interval = 32, \
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern int __node_distance(int, int);
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 8, \
.max_interval = 32, \
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ struct sched_group {
struct sched_domain {
/* These fields must be setup */
struct sched_domain *parent; /* top domain must be null terminated */
struct sched_domain *child; /* bottom domain must be null terminated */
struct sched_group *groups; /* the balancing groups of the domain */
cpumask_t span; /* span of all CPUs in this domain */
unsigned long min_interval; /* Minimum balance interval ms */
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#define SD_SIBLING_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 1, \
.max_interval = 2, \
Expand Down Expand Up @@ -119,6 +120,7 @@
#define SD_CPU_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 1, \
.max_interval = 4, \
Expand Down Expand Up @@ -146,6 +148,7 @@
#define SD_ALLNODES_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
.parent = NULL, \
.child = NULL, \
.groups = NULL, \
.min_interval = 64, \
.max_interval = 64*num_online_cpus(), \
Expand Down
40 changes: 30 additions & 10 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,21 +1286,29 @@ static int sched_balance_self(int cpu, int flag)
while (sd) {
cpumask_t span;
struct sched_group *group;
int new_cpu;
int weight;
int new_cpu, weight;

if (!(sd->flags & flag)) {
sd = sd->child;
continue;
}

span = sd->span;
group = find_idlest_group(sd, t, cpu);
if (!group)
goto nextlevel;
if (!group) {
sd = sd->child;
continue;
}

new_cpu = find_idlest_cpu(group, t, cpu);
if (new_cpu == -1 || new_cpu == cpu)
goto nextlevel;
if (new_cpu == -1 || new_cpu == cpu) {
/* Now try balancing at a lower domain level of cpu */
sd = sd->child;
continue;
}

/* Now try balancing at a lower domain level */
/* Now try balancing at a lower domain level of new_cpu */
cpu = new_cpu;
nextlevel:
sd = NULL;
weight = cpus_weight(span);
for_each_domain(cpu, tmp) {
Expand Down Expand Up @@ -5448,12 +5456,18 @@ static void cpu_attach_domain(struct sched_domain *sd, int cpu)
struct sched_domain *parent = tmp->parent;
if (!parent)
break;
if (sd_parent_degenerate(tmp, parent))
if (sd_parent_degenerate(tmp, parent)) {
tmp->parent = parent->parent;
if (parent->parent)
parent->parent->child = tmp;
}
}

if (sd && sd_degenerate(sd))
if (sd && sd_degenerate(sd)) {
sd = sd->parent;
if (sd)
sd->child = NULL;
}

sched_domain_debug(sd, cpu);

Expand Down Expand Up @@ -6288,6 +6302,8 @@ static int build_sched_domains(const cpumask_t *cpu_map)
*sd = SD_NODE_INIT;
sd->span = sched_domain_node_span(cpu_to_node(i));
sd->parent = p;
if (p)
p->child = sd;
cpus_and(sd->span, sd->span, *cpu_map);
#endif

Expand All @@ -6297,6 +6313,8 @@ static int build_sched_domains(const cpumask_t *cpu_map)
*sd = SD_CPU_INIT;
sd->span = nodemask;
sd->parent = p;
if (p)
p->child = sd;
sd->groups = &sched_group_phys[group];

#ifdef CONFIG_SCHED_MC
Expand All @@ -6307,6 +6325,7 @@ static int build_sched_domains(const cpumask_t *cpu_map)
sd->span = cpu_coregroup_map(i);
cpus_and(sd->span, sd->span, *cpu_map);
sd->parent = p;
p->child = sd;
sd->groups = &sched_group_core[group];
#endif

Expand All @@ -6318,6 +6337,7 @@ static int build_sched_domains(const cpumask_t *cpu_map)
sd->span = cpu_sibling_map[i];
cpus_and(sd->span, sd->span, *cpu_map);
sd->parent = p;
p->child = sd;
sd->groups = &sched_group_cpus[group];
#endif
}
Expand Down

0 comments on commit d3ed709

Please sign in to comment.