Skip to content

Commit 287cdaa

Browse files
vingu-linaroIngo Molnar
authored andcommitted
sched/fair: Fix scale_rt_capacity() for SMT
Since commit: 523e979 ("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: 523e979 ("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>
1 parent d0cdb3c commit 287cdaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/sched/fair.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7488,10 +7488,10 @@ static inline int get_sd_load_idx(struct sched_domain *sd,
74887488
return load_idx;
74897489
}
74907490

7491-
static unsigned long scale_rt_capacity(int cpu)
7491+
static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
74927492
{
74937493
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);
74957495
unsigned long used, free;
74967496
unsigned long irq;
74977497

@@ -7513,7 +7513,7 @@ static unsigned long scale_rt_capacity(int cpu)
75137513

75147514
static void update_cpu_capacity(struct sched_domain *sd, int cpu)
75157515
{
7516-
unsigned long capacity = scale_rt_capacity(cpu);
7516+
unsigned long capacity = scale_rt_capacity(sd, cpu);
75177517
struct sched_group *sdg = sd->groups;
75187518

75197519
cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);

0 commit comments

Comments
 (0)