linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: schedutil: fix equation in comment
@ 2019-08-02 10:46 Qais Yousef
  2019-08-02 13:19 ` Vincent Guittot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Qais Yousef @ 2019-08-02 10:46 UTC (permalink / raw)
  To: Peter Zijlstra, Rafael J . Wysocki
  Cc: Viresh Kumar, Ingo Molnar, linux-pm, linux-kernel, Qais Yousef

scale_irq_capacity() call in schedutil_cpu_util() does

	util *= (max - irq)
	util /= max

But the comment says

	util *= (1 - irq)
	util /= max

Fix the comment to match what the scaling function does.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
---
 kernel/sched/cpufreq_schedutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 636ca6f88c8e..e127d89d5974 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -259,9 +259,9 @@ unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs,
 	 * irq metric. Because IRQ/steal time is hidden from the task clock we
 	 * need to scale the task numbers:
 	 *
-	 *              1 - irq
-	 *   U' = irq + ------- * U
-	 *                max
+	 *              max - irq
+	 *   U' = irq + --------- * U
+	 *                 max
 	 */
 	util = scale_irq_capacity(util, irq, max);
 	util += irq;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpufreq: schedutil: fix equation in comment
  2019-08-02 10:46 [PATCH] cpufreq: schedutil: fix equation in comment Qais Yousef
@ 2019-08-02 13:19 ` Vincent Guittot
  2019-08-05  4:54 ` Viresh Kumar
  2019-08-05 13:06 ` Peter Zijlstra
  2 siblings, 0 replies; 6+ messages in thread
From: Vincent Guittot @ 2019-08-02 13:19 UTC (permalink / raw)
  To: Qais Yousef
  Cc: Peter Zijlstra, Rafael J . Wysocki, Viresh Kumar, Ingo Molnar,
	open list:THERMAL, linux-kernel

On Fri, 2 Aug 2019 at 12:46, Qais Yousef <qais.yousef@arm.com> wrote:
>
> scale_irq_capacity() call in schedutil_cpu_util() does
>
>         util *= (max - irq)
>         util /= max
>
> But the comment says
>
>         util *= (1 - irq)
>         util /= max
>
> Fix the comment to match what the scaling function does.
>
> Signed-off-by: Qais Yousef <qais.yousef@arm.com>

FWIW
Acked-by:  Vincent Guittot <vincent.guittot@linaro.org>
> ---
>  kernel/sched/cpufreq_schedutil.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 636ca6f88c8e..e127d89d5974 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -259,9 +259,9 @@ unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs,
>          * irq metric. Because IRQ/steal time is hidden from the task clock we
>          * need to scale the task numbers:
>          *
> -        *              1 - irq
> -        *   U' = irq + ------- * U
> -        *                max
> +        *              max - irq
> +        *   U' = irq + --------- * U
> +        *                 max
>          */
>         util = scale_irq_capacity(util, irq, max);
>         util += irq;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpufreq: schedutil: fix equation in comment
  2019-08-02 10:46 [PATCH] cpufreq: schedutil: fix equation in comment Qais Yousef
  2019-08-02 13:19 ` Vincent Guittot
@ 2019-08-05  4:54 ` Viresh Kumar
  2019-08-05 13:06 ` Peter Zijlstra
  2 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2019-08-05  4:54 UTC (permalink / raw)
  To: Qais Yousef
  Cc: Peter Zijlstra, Rafael J . Wysocki, Ingo Molnar, linux-pm, linux-kernel

On 02-08-19, 11:46, Qais Yousef wrote:
> scale_irq_capacity() call in schedutil_cpu_util() does
> 
> 	util *= (max - irq)
> 	util /= max
> 
> But the comment says
> 
> 	util *= (1 - irq)
> 	util /= max
> 
> Fix the comment to match what the scaling function does.
> 
> Signed-off-by: Qais Yousef <qais.yousef@arm.com>
> ---
>  kernel/sched/cpufreq_schedutil.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 636ca6f88c8e..e127d89d5974 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -259,9 +259,9 @@ unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs,
>  	 * irq metric. Because IRQ/steal time is hidden from the task clock we
>  	 * need to scale the task numbers:
>  	 *
> -	 *              1 - irq
> -	 *   U' = irq + ------- * U
> -	 *                max
> +	 *              max - irq
> +	 *   U' = irq + --------- * U
> +	 *                 max
>  	 */
>  	util = scale_irq_capacity(util, irq, max);
>  	util += irq;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpufreq: schedutil: fix equation in comment
  2019-08-02 10:46 [PATCH] cpufreq: schedutil: fix equation in comment Qais Yousef
  2019-08-02 13:19 ` Vincent Guittot
  2019-08-05  4:54 ` Viresh Kumar
@ 2019-08-05 13:06 ` Peter Zijlstra
  2019-08-07  9:42   ` Rafael J. Wysocki
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2019-08-05 13:06 UTC (permalink / raw)
  To: Qais Yousef
  Cc: Rafael J . Wysocki, Viresh Kumar, Ingo Molnar, linux-pm, linux-kernel

On Fri, Aug 02, 2019 at 11:46:28AM +0100, Qais Yousef wrote:
> scale_irq_capacity() call in schedutil_cpu_util() does
> 
> 	util *= (max - irq)
> 	util /= max
> 
> But the comment says
> 
> 	util *= (1 - irq)
> 	util /= max
> 
> Fix the comment to match what the scaling function does.
> 
> Signed-off-by: Qais Yousef <qais.yousef@arm.com>

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpufreq: schedutil: fix equation in comment
  2019-08-05 13:06 ` Peter Zijlstra
@ 2019-08-07  9:42   ` Rafael J. Wysocki
  2019-08-08 11:44     ` Qais Yousef
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2019-08-07  9:42 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Qais Yousef, Viresh Kumar, Ingo Molnar, linux-pm, linux-kernel

On Monday, August 5, 2019 3:06:20 PM CEST Peter Zijlstra wrote:
> On Fri, Aug 02, 2019 at 11:46:28AM +0100, Qais Yousef wrote:
> > scale_irq_capacity() call in schedutil_cpu_util() does
> > 
> > 	util *= (max - irq)
> > 	util /= max
> > 
> > But the comment says
> > 
> > 	util *= (1 - irq)
> > 	util /= max
> > 
> > Fix the comment to match what the scaling function does.
> > 
> > Signed-off-by: Qais Yousef <qais.yousef@arm.com>
> 
> Thanks!
> 

I've applied this, so please let me know if it has gone into -tip too and I'll drop it then.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpufreq: schedutil: fix equation in comment
  2019-08-07  9:42   ` Rafael J. Wysocki
@ 2019-08-08 11:44     ` Qais Yousef
  0 siblings, 0 replies; 6+ messages in thread
From: Qais Yousef @ 2019-08-08 11:44 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Peter Zijlstra, Viresh Kumar, Ingo Molnar, linux-pm, linux-kernel

On 08/07/19 11:42, Rafael J. Wysocki wrote:
> On Monday, August 5, 2019 3:06:20 PM CEST Peter Zijlstra wrote:
> > On Fri, Aug 02, 2019 at 11:46:28AM +0100, Qais Yousef wrote:
> > > scale_irq_capacity() call in schedutil_cpu_util() does
> > > 
> > > 	util *= (max - irq)
> > > 	util /= max
> > > 
> > > But the comment says
> > > 
> > > 	util *= (1 - irq)
> > > 	util /= max
> > > 
> > > Fix the comment to match what the scaling function does.
> > > 
> > > Signed-off-by: Qais Yousef <qais.yousef@arm.com>
> > 
> > Thanks!
> > 
> 
> I've applied this, so please let me know if it has gone into -tip too and I'll drop it then.

FYI I've just got an email from tip-bot that it was committed there.

Thanks!

--
Qais Yousef

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-08 11:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02 10:46 [PATCH] cpufreq: schedutil: fix equation in comment Qais Yousef
2019-08-02 13:19 ` Vincent Guittot
2019-08-05  4:54 ` Viresh Kumar
2019-08-05 13:06 ` Peter Zijlstra
2019-08-07  9:42   ` Rafael J. Wysocki
2019-08-08 11:44     ` Qais Yousef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).