mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid.
@ 2024-02-04 14:09 Lizhe
  2024-02-05  7:38 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Lizhe @ 2024-02-04 14:09 UTC (permalink / raw)
  To: vincent.guittot, ilpo.jarvinen, rafael, viresh.kumar
  Cc: linux-pm, linux-kernel, Lizhe

If the current frequency scaling policy is schedutil.
echo schedutil > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
This would result in an invalid frequency modulation interval.
In sugov_limit(), sg_policy->limits_changed is set to true.

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 44db4f59c4cc..a0af38fcb7e2 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2631,7 +2631,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
 
 	if (new_gov == policy->governor) {
 		pr_debug("governor limits update\n");
-		cpufreq_governor_limits(policy);
+		cpufreq_policy_apply_limits(policy);
 		return 0;
 	}
 
-- 
2.25.1


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

* Re: [PATCH] cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid.
  2024-02-04 14:09 [PATCH] cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid Lizhe
@ 2024-02-05  7:38 ` Viresh Kumar
       [not found]   ` <7654198e.15f6.18d78668d9b.Coremail.sensor1010@163.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2024-02-05  7:38 UTC (permalink / raw)
  To: Lizhe; +Cc: vincent.guittot, ilpo.jarvinen, rafael, linux-pm, linux-kernel

On 04-02-24, 06:09, Lizhe wrote:
> If the current frequency scaling policy is schedutil.
> echo schedutil > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
> This would result in an invalid frequency modulation interval.
> In sugov_limit(), sg_policy->limits_changed is set to true.

That will only make us do an extra freq change. What's the problem with that ?

> Signed-off-by: Lizhe <sensor1010@163.com>
> ---
>  drivers/cpufreq/cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 44db4f59c4cc..a0af38fcb7e2 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2631,7 +2631,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
>  
>  	if (new_gov == policy->governor) {
>  		pr_debug("governor limits update\n");
> -		cpufreq_governor_limits(policy);
> +		cpufreq_policy_apply_limits(policy);
>  		return 0;
>  	}

-- 
viresh

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

* Re: [PATCH] cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid.
       [not found]   ` <7654198e.15f6.18d78668d9b.Coremail.sensor1010@163.com>
@ 2024-02-05  8:54     ` Viresh Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2024-02-05  8:54 UTC (permalink / raw)
  To: lizhe; +Cc: vincent.guittot, ilpo.jarvinen, rafael, linux-pm, linux-kernel

On 05-02-24, 16:33, lizhe wrote:
> HI: 
>     I think not.
>     It will cause the following changes:
>     limits_changed in sugov_limit() is set to true.
>     This will cause the modulation interval to be invalid.
>     The system modulation will ignore the modulation interval.
>     A modulation request will be initiated immediately.
> 
> 
>    As shown below : 
>    sugov_should_update_freq(...)
>   {
>      if (unlikely(sg_policy->limits_changed)) {
>           ....
>           return true;
>      }
>   }
>   
>   Repeatedly setting the schedutil modulation policy causes the modulation interval to be invalid. 
>   Why is this necessary ? 

This is the penalty being paid to keep the interface simple and consistent.
Playing with sysfs can do such minor things.

-- 
viresh

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

end of thread, other threads:[~2024-02-05  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-04 14:09 [PATCH] cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid Lizhe
2024-02-05  7:38 ` Viresh Kumar
     [not found]   ` <7654198e.15f6.18d78668d9b.Coremail.sensor1010@163.com>
2024-02-05  8:54     ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®