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


Groups > linux.kernel > #1470946 > unrolled thread

[PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity

Started bySteve Muckle <steve.muckle@linaro.org>
First post2016-08-26 20:50 +0200
Last post2016-08-31 16:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity Steve Muckle <steve.muckle@linaro.org> - 2016-08-26 20:50 +0200
    Re: [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-31 03:30 +0200
      Re: [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu  capacity Peter Zijlstra <peterz@infradead.org> - 2016-08-31 16:40 +0200

#1470946 — [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity

FromSteve Muckle <steve.muckle@linaro.org>
Date2016-08-26 20:50 +0200
Subject[PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity
Message-ID<saumt-2ih-9@gated-at.bofh.it>
PELT does not consider SMT when scaling its utilization values via
arch_scale_cpu_capacity(). The value in rq->cpu_capacity_orig does
take SMT into consideration though and therefore may be smaller than
the utilization reported by PELT.

On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
util_avg scales up to 1024. This means that a 50% utilized CPU will show
up in schedutil as ~86% busy.

Fix this by using the same CPU scaling value in schedutil as that which
is used by PELT.

Signed-off-by: Steve Muckle <smuckle@linaro.org>
---
 kernel/sched/cpufreq_schedutil.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 60d985f4dc47..cb8a77b1ef1b 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -147,7 +147,9 @@ static unsigned int get_next_freq(struct sugov_cpu *sg_cpu, unsigned long util,
 static void sugov_get_util(unsigned long *util, unsigned long *max)
 {
 	struct rq *rq = this_rq();
-	unsigned long cfs_max = rq->cpu_capacity_orig;
+	unsigned long cfs_max;
+
+	cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
 
 	*util = min(rq->cfs.avg.util_avg, cfs_max);
 	*max = cfs_max;
-- 
2.7.3

[toc] | [next] | [standalone]


#1472969

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-08-31 03:30 +0200
Message-ID<sc2vL-4aP-1@gated-at.bofh.it>
In reply to#1470946
On Friday, August 26, 2016 11:40:47 AM Steve Muckle wrote:
> PELT does not consider SMT when scaling its utilization values via
> arch_scale_cpu_capacity(). The value in rq->cpu_capacity_orig does
> take SMT into consideration though and therefore may be smaller than
> the utilization reported by PELT.
> 
> On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
> util_avg scales up to 1024. This means that a 50% utilized CPU will show
> up in schedutil as ~86% busy.
> 
> Fix this by using the same CPU scaling value in schedutil as that which
> is used by PELT.
> 
> Signed-off-by: Steve Muckle <smuckle@linaro.org>

This is fine by me.

Peter, any objections?

> ---
>  kernel/sched/cpufreq_schedutil.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 60d985f4dc47..cb8a77b1ef1b 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -147,7 +147,9 @@ static unsigned int get_next_freq(struct sugov_cpu *sg_cpu, unsigned long util,
>  static void sugov_get_util(unsigned long *util, unsigned long *max)
>  {
>  	struct rq *rq = this_rq();
> -	unsigned long cfs_max = rq->cpu_capacity_orig;
> +	unsigned long cfs_max;
> +
> +	cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
>  
>  	*util = min(rq->cfs.avg.util_avg, cfs_max);
>  	*max = cfs_max;
> 

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1473544 — Re: [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity

FromPeter Zijlstra <peterz@infradead.org>
Date2016-08-31 16:40 +0200
SubjectRe: [PATCH 1/2] sched: cpufreq: ignore SMT when determining max cpu capacity
Message-ID<sceQh-3B0-7@gated-at.bofh.it>
In reply to#1472969
On Wed, Aug 31, 2016 at 03:27:30AM +0200, Rafael J. Wysocki wrote:
> On Friday, August 26, 2016 11:40:47 AM Steve Muckle wrote:
> > PELT does not consider SMT when scaling its utilization values via
> > arch_scale_cpu_capacity(). The value in rq->cpu_capacity_orig does
> > take SMT into consideration though and therefore may be smaller than
> > the utilization reported by PELT.
> > 
> > On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
> > util_avg scales up to 1024. This means that a 50% utilized CPU will show
> > up in schedutil as ~86% busy.
> > 
> > Fix this by using the same CPU scaling value in schedutil as that which
> > is used by PELT.
> > 
> > Signed-off-by: Steve Muckle <smuckle@linaro.org>
> 
> This is fine by me.
> 
> Peter, any objections?

No, looks good. Thanks

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web