Commit 287cdaac authored by Vincent Guittot's avatar Vincent Guittot Committed by Ingo Molnar

sched/fair: Fix scale_rt_capacity() for SMT

Since commit:

  523e979d ("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: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarSrikar 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: 523e979d ("sched/core: Use PELT for scale_rt_capacity()")
Link: http://lkml.kernel.org/r/20180904093626.GA23936@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent d0cdb3ce
...@@ -7488,10 +7488,10 @@ static inline int get_sd_load_idx(struct sched_domain *sd, ...@@ -7488,10 +7488,10 @@ static inline int get_sd_load_idx(struct sched_domain *sd,
return load_idx; return load_idx;
} }
static unsigned long scale_rt_capacity(int cpu) static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
{ {
struct rq *rq = cpu_rq(cpu); struct rq *rq = cpu_rq(cpu);
unsigned long max = arch_scale_cpu_capacity(NULL, cpu); unsigned long max = arch_scale_cpu_capacity(sd, cpu);
unsigned long used, free; unsigned long used, free;
unsigned long irq; unsigned long irq;
...@@ -7513,7 +7513,7 @@ static unsigned long scale_rt_capacity(int cpu) ...@@ -7513,7 +7513,7 @@ static unsigned long scale_rt_capacity(int cpu)
static void update_cpu_capacity(struct sched_domain *sd, int cpu) static void update_cpu_capacity(struct sched_domain *sd, int cpu)
{ {
unsigned long capacity = scale_rt_capacity(cpu); unsigned long capacity = scale_rt_capacity(sd, cpu);
struct sched_group *sdg = sd->groups; struct sched_group *sdg = sd->groups;
cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu); cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment