aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2018-09-04 05:36:26 -0400
committerIngo Molnar <mingo@kernel.org>2018-09-10 04:13:47 -0400
commit287cdaac5700c5b8970d739f73d742d863d3e2ca (patch)
tree69b28bcd4e43b0467c39a744e87a0692645f62ba
parentd0cdb3ce8834332d918fc9c8ff74f8a169ec9abe (diff)
sched/fair: Fix scale_rt_capacity() for SMT
Since commit: 523e979d3164 ("sched/core: Use PELT for scale_rt_capacity()") scale_rt_capacity() returns the remaining capacity and not a scale factor to apply on cpu_capacity_orig. arch_scale_cpu() is directly called by scale_rt_capacity() so we must take the sched_domain argument. Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: 523e979d3164 ("sched/core: Use PELT for scale_rt_capacity()") Link: http://lkml.kernel.org/r/20180904093626.GA23936@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c6b7d6daab20..f12d004be6a1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7488,10 +7488,10 @@ static inline int get_sd_load_idx(struct sched_domain *sd,
7488 return load_idx; 7488 return load_idx;
7489} 7489}
7490 7490
7491static unsigned long scale_rt_capacity(int cpu) 7491static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
7492{ 7492{
7493 struct rq *rq = cpu_rq(cpu); 7493 struct rq *rq = cpu_rq(cpu);
7494 unsigned long max = arch_scale_cpu_capacity(NULL, cpu); 7494 unsigned long max = arch_scale_cpu_capacity(sd, cpu);
7495 unsigned long used, free; 7495 unsigned long used, free;
7496 unsigned long irq; 7496 unsigned long irq;
7497 7497
@@ -7513,7 +7513,7 @@ static unsigned long scale_rt_capacity(int cpu)
7513 7513
7514static void update_cpu_capacity(struct sched_domain *sd, int cpu) 7514static void update_cpu_capacity(struct sched_domain *sd, int cpu)
7515{ 7515{
7516 unsigned long capacity = scale_rt_capacity(cpu); 7516 unsigned long capacity = scale_rt_capacity(sd, cpu);
7517 struct sched_group *sdg = sd->groups; 7517 struct sched_group *sdg = sd->groups;
7518 7518
7519 cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu); 7519 cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);