cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid.
PATCH 1/1 cpufreq/schedutil: When updating limitations, frequency modulation interval not become invalid.
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.
--- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +1 -1
@@ -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 ; }
Signature · 1 line
2.25.1
Viresh Kumar
maintainerQuoted 4 lines · Lizhe
If the current frequency scaling policy is schedutil.
echo schedutil >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governorThis would result in an invalid frequency modulation interval. Insugov_limit(),sg_policy->limits_changedis set to true.
That will only make us do an extra freq change. What's the problem with that ?
Quoted 17 lines
Signed-off-by Lizhe <[email protected]>--- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/cpufreq.c +1
-1@@ -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 ; }
Signature · 1 line
viresh
A message that is not in the archive (sent off-list or not yet received): [email protected]
Viresh Kumar
maintainerQuoted 18 lines · lizhe
HI:
I think not.
It will cause the following changes:
limits_changedinsugov_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; } }
Quoted 2 lines
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.
Signature · 1 line
viresh