2024-03-05 09:51:30

by Christian Loehle

[permalink] [raw]
Subject: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL comment

effective_cpu_util() flags were removed, so remove the comment part
mentioning it.

commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
reworked effective_cpu_util() removing enum cpu_util_type.

Signed-off-by: Christian Loehle <[email protected]>
---
kernel/sched/fair.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 533547e3c90a..6b0c47d00fd3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7849,8 +7849,6 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
* Performance domain frequency: utilization clamping
* must be considered since it affects the selection
* of the performance domain frequency.
- * NOTE: in case RT tasks are running, by default the
- * FREQUENCY_UTIL's utilization can be max OPP.
*/
eff_util = effective_cpu_util(cpu, util, &min, &max);

--
2.34.1



2024-03-05 15:18:07

by Vincent Guittot

[permalink] [raw]
Subject: Re: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL comment

On Tue, 5 Mar 2024 at 10:51, Christian Loehle <[email protected]> wrote:
>
> effective_cpu_util() flags were removed, so remove the comment part
> mentioning it.
>
> commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
> reworked effective_cpu_util() removing enum cpu_util_type.
>
> Signed-off-by: Christian Loehle <[email protected]>
> ---
> kernel/sched/fair.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 533547e3c90a..6b0c47d00fd3 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7849,8 +7849,6 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
> * Performance domain frequency: utilization clamping
> * must be considered since it affects the selection
> * of the performance domain frequency.
> - * NOTE: in case RT tasks are running, by default the
> - * FREQUENCY_UTIL's utilization can be max OPP.

Yes, it's no more accurate.
Should we update the comment instead of deleting it as the effect is
still there ?
"NOTE: in case RT tasks are running, by default the min utilization
can be max OPP."


> */
> eff_util = effective_cpu_util(cpu, util, &min, &max);
>
> --
> 2.34.1
>

2024-03-05 15:18:33

by Christian Loehle

[permalink] [raw]
Subject: Re: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL comment

On 05/03/2024 15:05, Vincent Guittot wrote:
> On Tue, 5 Mar 2024 at 10:51, Christian Loehle <[email protected]> wrote:
>>
>> effective_cpu_util() flags were removed, so remove the comment part
>> mentioning it.
>>
>> commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
>> reworked effective_cpu_util() removing enum cpu_util_type.
>>
>> Signed-off-by: Christian Loehle <[email protected]>
>> ---
>> kernel/sched/fair.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 533547e3c90a..6b0c47d00fd3 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -7849,8 +7849,6 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
>> * Performance domain frequency: utilization clamping
>> * must be considered since it affects the selection
>> * of the performance domain frequency.
>> - * NOTE: in case RT tasks are running, by default the
>> - * FREQUENCY_UTIL's utilization can be max OPP.
>
> Yes, it's no more accurate.
> Should we update the comment instead of deleting it as the effect is
> still there ?
> "NOTE: in case RT tasks are running, by default the min utilization
> can be max OPP."

I'm fine with either and that was my first thought here, too, but it did seem like
the comment was mostly placed there to justify the 'unexpected' high utilization
when explicitly passing FREQUENCY_UTIL and the need to clamp it then.
So removing did feel slightly more natural to me anyway.

So alternatively:

From: Christian Loehle <[email protected]>
Date: Tue, 5 Mar 2024 09:34:41 +0000
Subject: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL mention

effective_cpu_util() flags were removed, so remove mentioning of the
flag.

commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
reworked effective_cpu_util() removing enum cpu_util_type. Modify the
comment accordingly.

Signed-off-by: Christian Loehle <[email protected]>
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 533547e3c90a..f5151cbcd94e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7849,8 +7849,8 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
* Performance domain frequency: utilization clamping
* must be considered since it affects the selection
* of the performance domain frequency.
- * NOTE: in case RT tasks are running, by default the
- * FREQUENCY_UTIL's utilization can be max OPP.
+ * NOTE: in case RT tasks are running, by default the min
+ * utilization can be max OPP.
*/
eff_util = effective_cpu_util(cpu, util, &min, &max);

--
2.34.1


2024-03-05 15:40:28

by Vincent Guittot

[permalink] [raw]
Subject: Re: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL comment

On Tue, 5 Mar 2024 at 16:18, Christian Loehle <[email protected]> wrote:
>
> On 05/03/2024 15:05, Vincent Guittot wrote:
> > On Tue, 5 Mar 2024 at 10:51, Christian Loehle <[email protected]> wrote:
> >>
> >> effective_cpu_util() flags were removed, so remove the comment part
> >> mentioning it.
> >>
> >> commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
> >> reworked effective_cpu_util() removing enum cpu_util_type.
> >>
> >> Signed-off-by: Christian Loehle <[email protected]>
> >> ---
> >> kernel/sched/fair.c | 2 --
> >> 1 file changed, 2 deletions(-)
> >>
> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> >> index 533547e3c90a..6b0c47d00fd3 100644
> >> --- a/kernel/sched/fair.c
> >> +++ b/kernel/sched/fair.c
> >> @@ -7849,8 +7849,6 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
> >> * Performance domain frequency: utilization clamping
> >> * must be considered since it affects the selection
> >> * of the performance domain frequency.
> >> - * NOTE: in case RT tasks are running, by default the
> >> - * FREQUENCY_UTIL's utilization can be max OPP.
> >
> > Yes, it's no more accurate.
> > Should we update the comment instead of deleting it as the effect is
> > still there ?
> > "NOTE: in case RT tasks are running, by default the min utilization
> > can be max OPP."
>
> I'm fine with either and that was my first thought here, too, but it did seem like
> the comment was mostly placed there to justify the 'unexpected' high utilization
> when explicitly passing FREQUENCY_UTIL and the need to clamp it then.

The behavior is still there but it has moved in the min parameter .
The problem remains the same when it come to select a compute capacity
with sugov_effective_cpu_perf

> So removing did feel slightly more natural to me anyway.
>
> So alternatively:
>
> From: Christian Loehle <[email protected]>
> Date: Tue, 5 Mar 2024 09:34:41 +0000
> Subject: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL mention
>
> effective_cpu_util() flags were removed, so remove mentioning of the
> flag.
>
> commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
> reworked effective_cpu_util() removing enum cpu_util_type. Modify the
> comment accordingly.
>
> Signed-off-by: Christian Loehle <[email protected]>

Reviewed-by: Vincent Guittot <[email protected]>

> ---
> kernel/sched/fair.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 533547e3c90a..f5151cbcd94e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7849,8 +7849,8 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
> * Performance domain frequency: utilization clamping
> * must be considered since it affects the selection
> * of the performance domain frequency.
> - * NOTE: in case RT tasks are running, by default the
> - * FREQUENCY_UTIL's utilization can be max OPP.
> + * NOTE: in case RT tasks are running, by default the min
> + * utilization can be max OPP.
> */
> eff_util = effective_cpu_util(cpu, util, &min, &max);
>
> --
> 2.34.1
>

Subject: [tip: sched/urgent] sched/fair: Remove stale FREQUENCY_UTIL comment

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID: 7cb7fb5b49399fc59f1c44686d82c0df0776c8c6
Gitweb: https://git.kernel.org/tip/7cb7fb5b49399fc59f1c44686d82c0df0776c8c6
Author: Christian Loehle <[email protected]>
AuthorDate: Tue, 05 Mar 2024 15:18:20
Committer: Ingo Molnar <[email protected]>
CommitterDate: Fri, 17 May 2024 09:51:54 +02:00

sched/fair: Remove stale FREQUENCY_UTIL comment

On 05/03/2024 15:05, Vincent Guittot wrote:

I'm fine with either and that was my first thought here, too, but it did seem like
the comment was mostly placed there to justify the 'unexpected' high utilization
when explicitly passing FREQUENCY_UTIL and the need to clamp it then.
So removing did feel slightly more natural to me anyway.

So alternatively:

From: Christian Loehle <[email protected]>
Date: Tue, 5 Mar 2024 09:34:41 +0000
Subject: [PATCH] sched/fair: Remove stale FREQUENCY_UTIL mention

effective_cpu_util() flags were removed, so remove mentioning of the
flag.

commit 9c0b4bb7f6303 ("sched/cpufreq: Rework schedutil governor performance estimation")
reworked effective_cpu_util() removing enum cpu_util_type. Modify the
comment accordingly.

Signed-off-by: Christian Loehle <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Reviewed-by: Vincent Guittot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9009787..9744b50 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7900,8 +7900,8 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
* Performance domain frequency: utilization clamping
* must be considered since it affects the selection
* of the performance domain frequency.
- * NOTE: in case RT tasks are running, by default the
- * FREQUENCY_UTIL's utilization can be max OPP.
+ * NOTE: in case RT tasks are running, by default the min
+ * utilization can be max OPP.
*/
eff_util = effective_cpu_util(cpu, util, &min, &max);