[PATCH] cpufreq: cppc: discard out-of-range delivered_perf samples

Jie Zhan zhanjie9 at hisilicon.com
Fri May 8 01:55:26 PDT 2026



On 5/8/2026 4:17 PM, Breno Leitao wrote:
> Hello Jie,
> 
> On Fri, May 08, 2026 at 11:23:18AM +0800, Jie Zhan wrote:
>> On 5/2/2026 12:32 AM, Breno Leitao wrote:
>>> cppc_cpufreq_get_rate() derives delivered_perf as:
>>>
>>>     delivered_perf = reference_perf * delta_delivered / delta_reference
>>>
>>> over a short udelay()-bounded window between two cppc_get_perf_ctrs()
>>> calls. Per-read latency jitter on the underlying CPC register access
>>> can skew the ratio, occasionally producing delivered_perf >
>>> highest_perf. cppc_perf_to_khz() then linearly extrapolates above
>>> (nominal_perf, nominal_freq), so the value reported via
>>> /sys/.../cpufreq/cpuinfo_cur_freq exceeds cpuinfo_max_freq.
>>>
>>> Observed on an arm64 host (governor=performance,
>>> cpuinfo_max_freq=3339 MHz): 15 back-to-back reads returned values
>>> between 2997 and 4230 MHz.
>> Hi Breno,
>>
>> Frequency sampling discrepancy through 'cpuinfo_cur_freq' in the
>> cppc_cpufreq driver has been an issue discussed for a very long time.
> 
> Thanks for the heads-up.
> 
>> If the CPPC feedback counters are FFH on your platform, can you have a look
>> at [1] and see if that helps?
> 
> Have you forgot to get the [1] link here?
Yeah, totally forgot, sorry!

[1] https://lore.kernel.org/lkml/20260410094145.4132082-1-zhangpengjie2@huawei.com/
> 
> Thanks for looking at this,
> --breno



More information about the linux-arm-kernel mailing list