Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1466482

Re: [PATCH] sched: fix incorrect PELT values on SMT

From Dietmar Eggemann <dietmar.eggemann@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] sched: fix incorrect PELT values on SMT
Date 2016-08-19 17:10 +0200
Message-ID <s7TAJ-7du-13@gated-at.bofh.it> (permalink)
References <s7Hge-7z4-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Steve,

On 19/08/16 02:55, Steve Muckle wrote:
> PELT scales its util_sum and util_avg values via
> arch_scale_cpu_capacity(). If that function is passed the CPU's sched
> domain then it will reduce the scaling capacity if SD_SHARE_CPUCAPACITY
> is set. PELT does not pass in the sd however. The other caller of
> arch_scale_cpu_capacity, update_cpu_capacity(), does. This means
> util_sum and util_avg scale beyond the CPU capacity on SMT.
> 
> On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
> util_avg scales up to 1024.
> 
> Fix this by passing in the sd in __update_load_avg() as well.
> 
> Signed-off-by: Steve Muckle <smuckle@linaro.org>
> ---
>  kernel/sched/fair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 61d485421bed..95d34b337152 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2731,7 +2731,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
>  	sa->last_update_time = now;
>  
>  	scale_freq = arch_scale_freq_capacity(NULL, cpu);
> -	scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
> +	scale_cpu = arch_scale_cpu_capacity(cpu_rq(cpu)->sd, cpu);

Wouldn't you have to subscribe to this rcu pointer rq->sd w/ something
like 'rcu_dereference(cpu_rq(cpu)->sd)'?

IMHO, __update_load_avg() is called outside existing RCU read-side
critical sections as well so there would be a pair of
rcu_read_lock()/rcu_read_unlock() required in this case.

>  
>  	/* delta_w is the amount already accumulated against our next period */
>  	delta_w = sa->period_contrib;
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] sched: fix incorrect PELT values on SMT Steve Muckle <steve.muckle@linaro.org> - 2016-08-19 04:00 +0200
  Re: [PATCH] sched: fix incorrect PELT values on SMT Wanpeng Li <kernellwp@gmail.com> - 2016-08-19 04:40 +0200
    Re: [PATCH] sched: fix incorrect PELT values on SMT Steve Muckle <steve.muckle@linaro.org> - 2016-08-19 07:10 +0200
  Re: [PATCH] sched: fix incorrect PELT values on SMT Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-08-19 17:10 +0200
    Re: [PATCH] sched: fix incorrect PELT values on SMT Steve Muckle <steve.muckle@linaro.org> - 2016-08-19 22:20 +0200
  Re: [PATCH] sched: fix incorrect PELT values on SMT Morten Rasmussen <morten.rasmussen@arm.com> - 2016-08-19 17:40 +0200
    Re: [PATCH] sched: fix incorrect PELT values on SMT Steve Muckle <steve.muckle@linaro.org> - 2016-08-19 22:20 +0200
    Re: [PATCH] sched: fix incorrect PELT values on SMT Wanpeng Li <kernellwp@gmail.com> - 2016-08-22 04:40 +0200

csiph-web