diff options
| -rw-r--r-- | include/linux/sched.h | 2 | ||||
| -rw-r--r-- | kernel/sched/core.c | 81 | ||||
| -rw-r--r-- | kernel/sched/fair.c | 131 | ||||
| -rw-r--r-- | kernel/sched/sched.h | 16 |
4 files changed, 115 insertions, 115 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6790c3b42072..a96f03598c61 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1013,7 +1013,7 @@ typedef const int (*sched_domain_flags_f)(void); | |||
| 1013 | struct sd_data { | 1013 | struct sd_data { |
| 1014 | struct sched_domain **__percpu sd; | 1014 | struct sched_domain **__percpu sd; |
| 1015 | struct sched_group **__percpu sg; | 1015 | struct sched_group **__percpu sg; |
| 1016 | struct sched_group_power **__percpu sgp; | 1016 | struct sched_group_capacity **__percpu sgc; |
| 1017 | }; | 1017 | }; |
| 1018 | 1018 | ||
| 1019 | struct sched_domain_topology_level { | 1019 | struct sched_domain_topology_level { |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index afcc84234a3e..2e1fb0902200 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -5221,14 +5221,13 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, | |||
| 5221 | } | 5221 | } |
| 5222 | 5222 | ||
| 5223 | /* | 5223 | /* |
| 5224 | * Even though we initialize ->power to something semi-sane, | 5224 | * Even though we initialize ->capacity to something semi-sane, |
| 5225 | * we leave power_orig unset. This allows us to detect if | 5225 | * we leave capacity_orig unset. This allows us to detect if |
| 5226 | * domain iteration is still funny without causing /0 traps. | 5226 | * domain iteration is still funny without causing /0 traps. |
| 5227 | */ | 5227 | */ |
| 5228 | if (!group->sgp->power_orig) { | 5228 | if (!group->sgc->capacity_orig) { |
| 5229 | printk(KERN_CONT "\n"); | 5229 | printk(KERN_CONT "\n"); |
| 5230 | printk(KERN_ERR "ERROR: domain->cpu_power not " | 5230 | printk(KERN_ERR "ERROR: domain->cpu_capacity not set\n"); |
| 5231 | "set\n"); | ||
| 5232 | break; | 5231 | break; |
| 5233 | } | 5232 | } |
| 5234 | 5233 | ||
| @@ -5250,9 +5249,9 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, | |||
| 5250 | cpulist_scnprintf(str, sizeof(str), sched_group_cpus(group)); | 5249 | cpulist_scnprintf(str, sizeof(str), sched_group_cpus(group)); |
| 5251 | 5250 | ||
| 5252 | printk(KERN_CONT " %s", str); | 5251 | printk(KERN_CONT " %s", str); |
| 5253 | if (group->sgp->power != SCHED_POWER_SCALE) { | 5252 | if (group->sgc->capacity != SCHED_POWER_SCALE) { |
| 5254 | printk(KERN_CONT " (cpu_power = %d)", | 5253 | printk(KERN_CONT " (cpu_capacity = %d)", |
| 5255 | group->sgp->power); | 5254 | group->sgc->capacity); |
| 5256 | } | 5255 | } |
| 5257 | 5256 | ||
| 5258 | group = group->next; | 5257 | group = group->next; |
| @@ -5466,7 +5465,7 @@ static struct root_domain *alloc_rootdomain(void) | |||
| 5466 | return rd; | 5465 | return rd; |
| 5467 | } | 5466 | } |
| 5468 | 5467 | ||
| 5469 | static void free_sched_groups(struct sched_group *sg, int free_sgp) | 5468 | static void free_sched_groups(struct sched_group *sg, int free_sgc) |
| 5470 | { | 5469 | { |
| 5471 | struct sched_group *tmp, *first; | 5470 | struct sched_group *tmp, *first; |
| 5472 | 5471 | ||
| @@ -5477,8 +5476,8 @@ static void free_sched_groups(struct sched_group *sg, int free_sgp) | |||
| 5477 | do { | 5476 | do { |
| 5478 | tmp = sg->next; | 5477 | tmp = sg->next; |
| 5479 | 5478 | ||
| 5480 | if (free_sgp && atomic_dec_and_test(&sg->sgp->ref)) | 5479 | if (free_sgc && atomic_dec_and_test(&sg->sgc->ref)) |
| 5481 | kfree(sg->sgp); | 5480 | kfree(sg->sgc); |
| 5482 | 5481 | ||
| 5483 | kfree(sg); | 5482 | kfree(sg); |
| 5484 | sg = tmp; | 5483 | sg = tmp; |
| @@ -5496,7 +5495,7 @@ static void free_sched_domain(struct rcu_head *rcu) | |||
| 5496 | if (sd->flags & SD_OVERLAP) { | 5495 | if (sd->flags & SD_OVERLAP) { |
| 5497 | free_sched_groups(sd->groups, 1); | 5496 | free_sched_groups(sd->groups, 1); |
| 5498 | } else if (atomic_dec_and_test(&sd->groups->ref)) { | 5497 | } else if (atomic_dec_and_test(&sd->groups->ref)) { |
| 5499 | kfree(sd->groups->sgp); | 5498 | kfree(sd->groups->sgc); |
| 5500 | kfree(sd->groups); | 5499 | kfree(sd->groups); |
| 5501 | } | 5500 | } |
| 5502 | kfree(sd); | 5501 | kfree(sd); |
| @@ -5707,17 +5706,17 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu) | |||
| 5707 | 5706 | ||
| 5708 | cpumask_or(covered, covered, sg_span); | 5707 | cpumask_or(covered, covered, sg_span); |
| 5709 | 5708 | ||
| 5710 | sg->sgp = *per_cpu_ptr(sdd->sgp, i); | 5709 | sg->sgc = *per_cpu_ptr(sdd->sgc, i); |
| 5711 | if (atomic_inc_return(&sg->sgp->ref) == 1) | 5710 | if (atomic_inc_return(&sg->sgc->ref) == 1) |
| 5712 | build_group_mask(sd, sg); | 5711 | build_group_mask(sd, sg); |
| 5713 | 5712 | ||
| 5714 | /* | 5713 | /* |
| 5715 | * Initialize sgp->power such that even if we mess up the | 5714 | * Initialize sgc->capacity such that even if we mess up the |
| 5716 | * domains and no possible iteration will get us here, we won't | 5715 | * domains and no possible iteration will get us here, we won't |
| 5717 | * die on a /0 trap. | 5716 | * die on a /0 trap. |
| 5718 | */ | 5717 | */ |
| 5719 | sg->sgp->power = SCHED_POWER_SCALE * cpumask_weight(sg_span); | 5718 | sg->sgc->capacity = SCHED_POWER_SCALE * cpumask_weight(sg_span); |
| 5720 | sg->sgp->power_orig = sg->sgp->power; | 5719 | sg->sgc->capacity_orig = sg->sgc->capacity; |
| 5721 | 5720 | ||
| 5722 | /* | 5721 | /* |
| 5723 | * Make sure the first group of this domain contains the | 5722 | * Make sure the first group of this domain contains the |
| @@ -5755,8 +5754,8 @@ static int get_group(int cpu, struct sd_data *sdd, struct sched_group **sg) | |||
| 5755 | 5754 | ||
| 5756 | if (sg) { | 5755 | if (sg) { |
| 5757 | *sg = *per_cpu_ptr(sdd->sg, cpu); | 5756 | *sg = *per_cpu_ptr(sdd->sg, cpu); |
| 5758 | (*sg)->sgp = *per_cpu_ptr(sdd->sgp, cpu); | 5757 | (*sg)->sgc = *per_cpu_ptr(sdd->sgc, cpu); |
| 5759 | atomic_set(&(*sg)->sgp->ref, 1); /* for claim_allocations */ | 5758 | atomic_set(&(*sg)->sgc->ref, 1); /* for claim_allocations */ |
| 5760 | } | 5759 | } |
| 5761 | 5760 | ||
| 5762 | return cpu; | 5761 | return cpu; |
| @@ -5819,16 +5818,16 @@ build_sched_groups(struct sched_domain *sd, int cpu) | |||
| 5819 | } | 5818 | } |
| 5820 | 5819 | ||
| 5821 | /* | 5820 | /* |
| 5822 | * Initialize sched groups cpu_power. | 5821 | * Initialize sched groups cpu_capacity. |
| 5823 | * | 5822 | * |
| 5824 | * cpu_power indicates the capacity of sched group, which is used while | 5823 | * cpu_capacity indicates the capacity of sched group, which is used while |
| 5825 | * distributing the load between different sched groups in a sched domain. | 5824 | * distributing the load between different sched groups in a sched domain. |
| 5826 | * Typically cpu_power for all the groups in a sched domain will be same unless | 5825 | * Typically cpu_capacity for all the groups in a sched domain will be same |
| 5827 | * there are asymmetries in the topology. If there are asymmetries, group | 5826 | * unless there are asymmetries in the topology. If there are asymmetries, |
| 5828 | * having more cpu_power will pickup more load compared to the group having | 5827 | * group having more cpu_capacity will pickup more load compared to the |
| 5829 | * less cpu_power. | 5828 | * group having less cpu_capacity. |
| 5830 | */ | 5829 | */ |
| 5831 | static void init_sched_groups_power(int cpu, struct sched_domain *sd) | 5830 | static void init_sched_groups_capacity(int cpu, struct sched_domain *sd) |
| 5832 | { | 5831 | { |
| 5833 | struct sched_group *sg = sd->groups; | 5832 | struct sched_group *sg = sd->groups; |
| 5834 | 5833 | ||
| @@ -5842,8 +5841,8 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) | |||
| 5842 | if (cpu != group_balance_cpu(sg)) | 5841 | if (cpu != group_balance_cpu(sg)) |
| 5843 | return; | 5842 | return; |
| 5844 | 5843 | ||
| 5845 | update_group_power(sd, cpu); | 5844 | update_group_capacity(sd, cpu); |
| 5846 | atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight); | 5845 | atomic_set(&sg->sgc->nr_busy_cpus, sg->group_weight); |
| 5847 | } | 5846 | } |
| 5848 | 5847 | ||
| 5849 | /* | 5848 | /* |
| @@ -5934,8 +5933,8 @@ static void claim_allocations(int cpu, struct sched_domain *sd) | |||
| 5934 | if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref)) | 5933 | if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref)) |
| 5935 | *per_cpu_ptr(sdd->sg, cpu) = NULL; | 5934 | *per_cpu_ptr(sdd->sg, cpu) = NULL; |
| 5936 | 5935 | ||
| 5937 | if (atomic_read(&(*per_cpu_ptr(sdd->sgp, cpu))->ref)) | 5936 | if (atomic_read(&(*per_cpu_ptr(sdd->sgc, cpu))->ref)) |
| 5938 | *per_cpu_ptr(sdd->sgp, cpu) = NULL; | 5937 | *per_cpu_ptr(sdd->sgc, cpu) = NULL; |
| 5939 | } | 5938 | } |
| 5940 | 5939 | ||
| 5941 | #ifdef CONFIG_NUMA | 5940 | #ifdef CONFIG_NUMA |
| @@ -6337,14 +6336,14 @@ static int __sdt_alloc(const struct cpumask *cpu_map) | |||
| 6337 | if (!sdd->sg) | 6336 | if (!sdd->sg) |
| 6338 | return -ENOMEM; | 6337 | return -ENOMEM; |
| 6339 | 6338 | ||
| 6340 | sdd->sgp = alloc_percpu(struct sched_group_power *); | 6339 | sdd->sgc = alloc_percpu(struct sched_group_capacity *); |
| 6341 | if (!sdd->sgp) | 6340 | if (!sdd->sgc) |
| 6342 | return -ENOMEM; | 6341 | return -ENOMEM; |
| 6343 | 6342 | ||
| 6344 | for_each_cpu(j, cpu_map) { | 6343 | for_each_cpu(j, cpu_map) { |
| 6345 | struct sched_domain *sd; | 6344 | struct sched_domain *sd; |
| 6346 | struct sched_group *sg; | 6345 | struct sched_group *sg; |
| 6347 | struct sched_group_power *sgp; | 6346 | struct sched_group_capacity *sgc; |
| 6348 | 6347 | ||
| 6349 | sd = kzalloc_node(sizeof(struct sched_domain) + cpumask_size(), | 6348 | sd = kzalloc_node(sizeof(struct sched_domain) + cpumask_size(), |
| 6350 | GFP_KERNEL, cpu_to_node(j)); | 6349 | GFP_KERNEL, cpu_to_node(j)); |
| @@ -6362,12 +6361,12 @@ static int __sdt_alloc(const struct cpumask *cpu_map) | |||
