diff options
author | Mike Travis <travis@sgi.com> | 2008-05-12 15:21:13 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 12:35:12 -0400 |
commit | 363ab6f1424cdea63e5d182312d60e19077b892a (patch) | |
tree | e200197412691015ca8de083155985e7e460ecfc /kernel/sched.c | |
parent | 068b12772a64c2440ef2f64ac5d780688c06576f (diff) |
core: use performance variant for_each_cpu_mask_nr
Change references from for_each_cpu_mask to for_each_cpu_mask_nr
where appropriate
Reviewed-by: Paul Jackson <pj@sgi.com>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1ed8011db826..814d6e17f1e1 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2271,7 +2271,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) | |||
2271 | /* Tally up the load of all CPUs in the group */ | 2271 | /* Tally up the load of all CPUs in the group */ |
2272 | avg_load = 0; | 2272 | avg_load = 0; |
2273 | 2273 | ||
2274 | for_each_cpu_mask(i, group->cpumask) { | 2274 | for_each_cpu_mask_nr(i, group->cpumask) { |
2275 | /* Bias balancing toward cpus of our domain */ | 2275 | /* Bias balancing toward cpus of our domain */ |
2276 | if (local_group) | 2276 | if (local_group) |
2277 | load = source_load(i, load_idx); | 2277 | load = source_load(i, load_idx); |
@@ -2313,7 +2313,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu, | |||
2313 | /* Traverse only the allowed CPUs */ | 2313 | /* Traverse only the allowed CPUs */ |
2314 | cpus_and(*tmp, group->cpumask, p->cpus_allowed); | 2314 | cpus_and(*tmp, group->cpumask, p->cpus_allowed); |
2315 | 2315 | ||
2316 | for_each_cpu_mask(i, *tmp) { | 2316 | for_each_cpu_mask_nr(i, *tmp) { |
2317 | load = weighted_cpuload(i); | 2317 | load = weighted_cpuload(i); |
2318 | 2318 | ||
2319 | if (load < min_load || (load == min_load && i == this_cpu)) { | 2319 | if (load < min_load || (load == min_load && i == this_cpu)) { |
@@ -3296,7 +3296,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, | |||
3296 | max_cpu_load = 0; | 3296 | max_cpu_load = 0; |
3297 | min_cpu_load = ~0UL; | 3297 | min_cpu_load = ~0UL; |
3298 | 3298 | ||
3299 | for_each_cpu_mask(i, group->cpumask) { | 3299 | for_each_cpu_mask_nr(i, group->cpumask) { |
3300 | struct rq *rq; | 3300 | struct rq *rq; |
3301 | 3301 | ||
3302 | if (!cpu_isset(i, *cpus)) | 3302 | if (!cpu_isset(i, *cpus)) |
@@ -3560,7 +3560,7 @@ find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle, | |||
3560 | unsigned long max_load = 0; | 3560 | unsigned long max_load = 0; |
3561 | int i; | 3561 | int i; |
3562 | 3562 | ||
3563 | for_each_cpu_mask(i, group->cpumask) { | 3563 | for_each_cpu_mask_nr(i, group->cpumask) { |
3564 | unsigned long wl; | 3564 | unsigned long wl; |
3565 | 3565 | ||
3566 | if (!cpu_isset(i, *cpus)) | 3566 | if (!cpu_isset(i, *cpus)) |
@@ -4100,7 +4100,7 @@ static void run_rebalance_domains(struct softirq_action *h) | |||
4100 | int balance_cpu; | 4100 | int balance_cpu; |
4101 | 4101 | ||
4102 | cpu_clear(this_cpu, cpus); | 4102 | cpu_clear(this_cpu, cpus); |
4103 | for_each_cpu_mask(balance_cpu, cpus) { | 4103 | for_each_cpu_mask_nr(balance_cpu, cpus) { |
4104 | /* | 4104 | /* |
4105 | * If this cpu gets work to do, stop the load balancing | 4105 | * If this cpu gets work to do, stop the load balancing |
4106 | * work being done for other cpus. Next load | 4106 | * work being done for other cpus. Next load |
@@ -6832,7 +6832,7 @@ init_sched_build_groups(const cpumask_t *span, const cpumask_t *cpu_map, | |||
6832 | 6832 | ||
6833 | cpus_clear(*covered); | 6833 | cpus_clear(*covered); |
6834 | 6834 | ||
6835 | for_each_cpu_mask(i, *span) { | 6835 | for_each_cpu_mask_nr(i, *span) { |
6836 | struct sched_group *sg; | 6836 | struct sched_group *sg; |
6837 | int group = group_fn(i, cpu_map, &sg, tmpmask); | 6837 | int group = group_fn(i, cpu_map, &sg, tmpmask); |
6838 | int j; | 6838 | int j; |
@@ -6843,7 +6843,7 @@ init_sched_build_groups(const cpumask_t *span, const cpumask_t *cpu_map, | |||
6843 | cpus_clear(sg->cpumask); | 6843 | cpus_clear(sg->cpumask); |
6844 | sg->__cpu_power = 0; | 6844 | sg->__cpu_power = 0; |
6845 | 6845 | ||
6846 | for_each_cpu_mask(j, *span) { | 6846 | for_each_cpu_mask_nr(j, *span) { |
6847 | if (group_fn(j, cpu_map, NULL, tmpmask) != group) | 6847 | if (group_fn(j, cpu_map, NULL, tmpmask) != group) |
6848 | continue; | 6848 | continue; |
6849 | 6849 | ||
@@ -7043,7 +7043,7 @@ static void init_numa_sched_groups_power(struct sched_group *group_head) | |||
7043 | if (!sg) | 7043 | if (!sg) |
7044 | return; | 7044 | return; |
7045 | do { | 7045 | do { |
7046 | for_each_cpu_mask(j, sg->cpumask) { | 7046 | for_each_cpu_mask_nr(j, sg->cpumask) { |
7047 | struct sched_domain *sd; | 7047 | struct sched_domain *sd; |
7048 | 7048 | ||
7049 | sd = &per_cpu(phys_domains, j); | 7049 | sd = &per_cpu(phys_domains, j); |
@@ -7068,7 +7068,7 @@ static void free_sched_groups(const cpumask_t *cpu_map, cpumask_t *nodemask) | |||
7068 | { | 7068 | { |
7069 | int cpu, i; | 7069 | int cpu, i; |
7070 | 7070 | ||
7071 | for_each_cpu_mask(cpu, *cpu_map) { | 7071 | for_each_cpu_mask_nr(cpu, *cpu_map) { |
7072 | struct sched_group **sched_group_nodes | 7072 | struct sched_group **sched_group_nodes |
7073 | = sched_group_nodes_bycpu[cpu]; | 7073 | = sched_group_nodes_bycpu[cpu]; |
7074 | 7074 | ||
@@ -7302,7 +7302,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7302 | /* | 7302 | /* |
7303 | * Set up domains for cpus specified by the cpu_map. | 7303 | * Set up domains for cpus specified by the cpu_map. |
7304 | */ | 7304 | */ |
7305 | for_each_cpu_mask(i, *cpu_map) { | 7305 | for_each_cpu_mask_nr(i, *cpu_map) { |
7306 | struct sched_domain *sd = NULL, *p; | 7306 | struct sched_domain *sd = NULL, *p; |
7307 | SCHED_CPUMASK_VAR(nodemask, allmasks); | 7307 | SCHED_CPUMASK_VAR(nodemask, allmasks); |
7308 | 7308 | ||
@@ -7374,7 +7374,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7374 | 7374 | ||
7375 | #ifdef CONFIG_SCHED_SMT | 7375 | #ifdef CONFIG_SCHED_SMT |
7376 | /* Set up CPU (sibling) groups */ | 7376 | /* Set up CPU (sibling) groups */ |
7377 | for_each_cpu_mask(i, *cpu_map) { | 7377 | for_each_cpu_mask_nr(i, *cpu_map) { |
7378 | SCHED_CPUMASK_VAR(this_sibling_map, allmasks); | 7378 | SCHED_CPUMASK_VAR(this_sibling_map, allmasks); |
7379 | SCHED_CPUMASK_VAR(send_covered, allmasks); | 7379 | SCHED_CPUMASK_VAR(send_covered, allmasks); |
7380 | 7380 | ||
@@ -7391,7 +7391,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7391 | 7391 | ||
7392 | #ifdef CONFIG_SCHED_MC | 7392 | #ifdef CONFIG_SCHED_MC |
7393 | /* Set up multi-core groups */ | 7393 | /* Set up multi-core groups */ |
7394 | for_each_cpu_mask(i, *cpu_map) { | 7394 | for_each_cpu_mask_nr(i, *cpu_map) { |
7395 | SCHED_CPUMASK_VAR(this_core_map, allmasks); | 7395 | SCHED_CPUMASK_VAR(this_core_map, allmasks); |
7396 | SCHED_CPUMASK_VAR(send_covered, allmasks); | 7396 | SCHED_CPUMASK_VAR(send_covered, allmasks); |
7397 | 7397 | ||
@@ -7458,7 +7458,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7458 | goto error; | 7458 | goto error; |
7459 | } | 7459 | } |
7460 | sched_group_nodes[i] = sg; | 7460 | sched_group_nodes[i] = sg; |
7461 | for_each_cpu_mask(j, *nodemask) { | 7461 | for_each_cpu_mask_nr(j, *nodemask) { |
7462 | struct sched_domain *sd; | 7462 | struct sched_domain *sd; |
7463 | 7463 | ||
7464 | sd = &per_cpu(node_domains, j); | 7464 | sd = &per_cpu(node_domains, j); |
@@ -7504,21 +7504,21 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7504 | 7504 | ||
7505 | /* Calculate CPU power for physical packages and nodes */ | 7505 | /* Calculate CPU power for physical packages and nodes */ |
7506 | #ifdef CONFIG_SCHED_SMT | 7506 | #ifdef CONFIG_SCHED_SMT |
7507 | for_each_cpu_mask(i, *cpu_map) { | 7507 | for_each_cpu_mask_nr(i, *cpu_map) { |
7508 | struct sched_domain *sd = &per_cpu(cpu_domains, i); | 7508 | struct sched_domain *sd = &per_cpu(cpu_domains, i); |
7509 | 7509 | ||
7510 | init_sched_groups_power(i, sd); | 7510 | init_sched_groups_power(i, sd); |
7511 | } | 7511 | } |
7512 | #endif | 7512 | #endif |
7513 | #ifdef CONFIG_SCHED_MC | 7513 | #ifdef CONFIG_SCHED_MC |
7514 | for_each_cpu_mask(i, *cpu_map) { | 7514 | for_each_cpu_mask_nr(i, *cpu_map) { |
7515 | struct sched_domain *sd = &per_cpu(core_domains, i); | 7515 | struct sched_domain *sd = &per_cpu(core_domains, i); |
7516 | 7516 | ||
7517 | init_sched_groups_power(i, sd); | 7517 | init_sched_groups_power(i, sd); |
7518 | } | 7518 | } |
7519 | #endif | 7519 | #endif |
7520 | 7520 | ||
7521 | for_each_cpu_mask(i, *cpu_map) { | 7521 | for_each_cpu_mask_nr(i, *cpu_map) { |
7522 | struct sched_domain *sd = &per_cpu(phys_domains, i); | 7522 | struct sched_domain *sd = &per_cpu(phys_domains, i); |
7523 | 7523 | ||
7524 | init_sched_groups_power(i, sd); | 7524 | init_sched_groups_power(i, sd); |
@@ -7538,7 +7538,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map, | |||
7538 | #endif | 7538 | #endif |
7539 | 7539 | ||
7540 | /* Attach the domains */ | 7540 | /* Attach the domains */ |
7541 | for_each_cpu_mask(i, *cpu_map) { | 7541 | for_each_cpu_mask_nr(i, *cpu_map) { |
7542 | struct sched_domain *sd; | 7542 | struct sched_domain *sd; |
7543 | #ifdef CONFIG_SCHED_SMT | 7543 | #ifdef CONFIG_SCHED_SMT |
7544 | sd = &per_cpu(cpu_domains, i); | 7544 | sd = &per_cpu(cpu_domains, i); |
@@ -7621,7 +7621,7 @@ static void detach_destroy_domains(const cpumask_t *cpu_map) | |||
7621 | 7621 | ||
7622 | unregister_sched_domain_sysctl(); | 7622 | unregister_sched_domain_sysctl(); |
7623 | 7623 | ||
7624 | for_each_cpu_mask(i, *cpu_map) | 7624 | for_each_cpu_mask_nr(i, *cpu_map) |
7625 | cpu_attach_domain(NULL, &def_root_domain, i); | 7625 | cpu_attach_domain(NULL, &def_root_domain, i); |
7626 | synchronize_sched(); | 7626 | synchronize_sched(); |
7627 | arch_destroy_sched_domains(cpu_map, &tmpmask); | 7627 | arch_destroy_sched_domains(cpu_map, &tmpmask); |