lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 31 Aug 2021 10:28:41 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     schspa <schspa@...il.com>
Cc:     rjw@...ysocki.net, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq_ondemand: fix bad auto calculated frequency.

On 27-08-21, 16:17, schspa wrote:
> We can litmit cpufreq range by change min & max from cpufreq_policy.
> So cpu frequency target should be in range [policy->min, policy->max].
> 
> Signed-off-by: schspa <schspa@...il.com>
> ---
>  drivers/cpufreq/cpufreq_ondemand.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
> index ac361a8b1d3b..8afb2c84c38c 100644
> --- a/drivers/cpufreq/cpufreq_ondemand.c
> +++ b/drivers/cpufreq/cpufreq_ondemand.c
> @@ -151,8 +151,8 @@ static void od_update(struct cpufreq_policy *policy)
>  		/* Calculate the next frequency proportional to load */
>  		unsigned int freq_next, min_f, max_f;
>  
> -		min_f = policy->cpuinfo.min_freq;
> -		max_f = policy->cpuinfo.max_freq;
> +		min_f = policy->min;
> +		max_f = policy->max;
>  		freq_next = min_f + load * (max_f - min_f) / 100;

No. The current calculations are right. The new frequency is proportional to
current load and it needs to take into account the entire freq range of the
CPUs. Note that we will eventually try to get the resultant frequency within
policy->min/max range in __cpufreq_driver_target().

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ