Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24282
b: refs/heads/master
c: 0806903
h: refs/heads/master
v: v3
  • Loading branch information
Siddha, Suresh B authored and Linus Torvalds committed Mar 27, 2006
1 parent 05b52a7 commit c3cc1d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 34 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: 1e9f28fa1eb9773bf65bae08288c6a0a38eef4a7
refs/heads/master: 0806903316d516a3b3851c51cea5c71724d9051d
62 changes: 29 additions & 33 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5621,6 +5621,32 @@ static int cpu_to_allnodes_group(int cpu)
{
return cpu_to_node(cpu);
}
static void init_numa_sched_groups_power(struct sched_group *group_head)
{
struct sched_group *sg = group_head;
int j;

if (!sg)
return;
next_sg:
for_each_cpu_mask(j, sg->cpumask) {
struct sched_domain *sd;

sd = &per_cpu(phys_domains, j);
if (j != first_cpu(sd->groups->cpumask)) {
/*
* Only add "power" once for each
* physical package.
*/
continue;
}

sg->cpu_power += sd->groups->cpu_power;
}
sg = sg->next;
if (sg != group_head)
goto next_sg;
}
#endif

/*
Expand Down Expand Up @@ -5866,43 +5892,13 @@ void build_sched_domains(const cpumask_t *cpu_map)
(cpus_weight(sd->groups->cpumask)-1) / 10;
sd->groups->cpu_power = power;
#endif

#ifdef CONFIG_NUMA
sd = &per_cpu(allnodes_domains, i);
if (sd->groups) {
power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE *
(cpus_weight(sd->groups->cpumask)-1) / 10;
sd->groups->cpu_power = power;
}
#endif
}

#ifdef CONFIG_NUMA
for (i = 0; i < MAX_NUMNODES; i++) {
struct sched_group *sg = sched_group_nodes[i];
int j;

if (sg == NULL)
continue;
next_sg:
for_each_cpu_mask(j, sg->cpumask) {
struct sched_domain *sd;
for (i = 0; i < MAX_NUMNODES; i++)
init_numa_sched_groups_power(sched_group_nodes[i]);

sd = &per_cpu(phys_domains, j);
if (j != first_cpu(sd->groups->cpumask)) {
/*
* Only add "power" once for each
* physical package.
*/
continue;
}

sg->cpu_power += sd->groups->cpu_power;
}
sg = sg->next;
if (sg != sched_group_nodes[i])
goto next_sg;
}
init_numa_sched_groups_power(sched_group_allnodes);
#endif

/* Attach the domains */
Expand Down

0 comments on commit c3cc1d1

Please sign in to comment.