diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/fair.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index eb87229ed4af..be530e40ceb9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -5705,19 +5705,17 @@ unsigned long __weak arch_scale_freq_capacity(struct sched_domain *sd, int cpu) | |||
5705 | return default_scale_capacity(sd, cpu); | 5705 | return default_scale_capacity(sd, cpu); |
5706 | } | 5706 | } |
5707 | 5707 | ||
5708 | static unsigned long default_scale_smt_capacity(struct sched_domain *sd, int cpu) | 5708 | static unsigned long default_scale_cpu_capacity(struct sched_domain *sd, int cpu) |
5709 | { | 5709 | { |
5710 | unsigned long weight = sd->span_weight; | 5710 | if ((sd->flags & SD_SHARE_CPUCAPACITY) && (sd->span_weight > 1)) |
5711 | unsigned long smt_gain = sd->smt_gain; | 5711 | return sd->smt_gain / sd->span_weight; |
5712 | 5712 | ||
5713 | smt_gain /= weight; | 5713 | return SCHED_CAPACITY_SCALE; |
5714 | |||
5715 | return smt_gain; | ||
5716 | } | 5714 | } |
5717 | 5715 | ||
5718 | unsigned long __weak arch_scale_smt_capacity(struct sched_domain *sd, int cpu) | 5716 | unsigned long __weak arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) |
5719 | { | 5717 | { |
5720 | return default_scale_smt_capacity(sd, cpu); | 5718 | return default_scale_cpu_capacity(sd, cpu); |
5721 | } | 5719 | } |
5722 | 5720 | ||
5723 | static unsigned long scale_rt_capacity(int cpu) | 5721 | static unsigned long scale_rt_capacity(int cpu) |
@@ -5756,18 +5754,15 @@ static unsigned long scale_rt_capacity(int cpu) | |||
5756 | 5754 | ||
5757 | static void update_cpu_capacity(struct sched_domain *sd, int cpu) | 5755 | static void update_cpu_capacity(struct sched_domain *sd, int cpu) |
5758 | { | 5756 | { |
5759 | unsigned long weight = sd->span_weight; | ||
5760 | unsigned long capacity = SCHED_CAPACITY_SCALE; | 5757 | unsigned long capacity = SCHED_CAPACITY_SCALE; |
5761 | struct sched_group *sdg = sd->groups; | 5758 | struct sched_group *sdg = sd->groups; |
5762 | 5759 | ||
5763 | if ((sd->flags & SD_SHARE_CPUCAPACITY) && weight > 1) { | 5760 | if (sched_feat(ARCH_CAPACITY)) |
5764 | if (sched_feat(ARCH_CAPACITY)) | 5761 | capacity *= arch_scale_cpu_capacity(sd, cpu); |
5765 | capacity *= arch_scale_smt_capacity(sd, cpu); | 5762 | else |
5766 | else | 5763 | capacity *= default_scale_cpu_capacity(sd, cpu); |
5767 | capacity *= default_scale_smt_capacity(sd, cpu); | ||
5768 | 5764 | ||
5769 | capacity >>= SCHED_CAPACITY_SHIFT; | 5765 | capacity >>= SCHED_CAPACITY_SHIFT; |
5770 | } | ||
5771 | 5766 | ||
5772 | sdg->sgc->capacity_orig = capacity; | 5767 | sdg->sgc->capacity_orig = capacity; |
5773 | 5768 | ||