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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240320032056.2noz6lu3k2utcpid@vireshk-i7>
Date: Wed, 20 Mar 2024 08:50:56 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Xuewen Yan <xuewen.yan@...soc.com>
Cc: rafael@...nel.org, ke.wang@...soc.com, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, xuewen.yan94@...il.com,
	di.shen@...soc.com
Subject: Re: [PATCH] cpufreq: Use a smaller freq for the policy->max when
 verify

On 19-03-24, 16:01, Xuewen Yan wrote:
> When driver use the cpufreq_frequency_table_verify() as the
> cpufreq_driver->verify's callback. It may cause the policy->max
> bigger than the freq_qos's max freq.
> 
> Just as follow:
> 
> unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_available_frequencies
> 614400 768000 988000 1228800 1469000 1586000 1690000 1833000 2002000 2093000
> 
> unisoc:/sys/devices/system/cpu/cpufreq/policy0 # echo 1900000 > scaling_max_freq
> unisoc:/sys/devices/system/cpu/cpufreq/policy0 # echo 1900000 > scaling_min_freq
> unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_max_freq
> 2002000
> unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_min_freq
> 2002000
> 
> When user set the qos_min and qos_max as the same value, and the value
> is not in the freq-table, the above scenario will occur.
> 
> This is because in cpufreq_frequency_table_verify() func, when it can not
> find the freq in table, it will change the policy->max to be a bigger freq,
> as above, because there is no 1.9G in the freq-table, the policy->max would
> be set to 2.002G. As a result, the cpufreq_policy->max is bigger than the
> user's qos_max. This is unreasonable.
> 
> So use a smaller freq when can not find the freq in fre-table, to prevent

                                                      freq-table

> the policy->max exceed the qos's max freq.
> 
> Signed-off-by: Xuewen Yan <xuewen.yan@...soc.com>
> ---
>  drivers/cpufreq/freq_table.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

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

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ