diff options
| author | Naresh Solanki <[email protected]> | 2024-12-19 20:18:32 +0000 |
|---|---|---|
| committer | Mario Limonciello <[email protected]> | 2025-01-04 05:44:07 +0000 |
| commit | 857a61c2ce74e30fc3b10bc89d68ddd8d05b188c (patch) | |
| tree | d47ecbeac41380272020a21bc34dcc9c8d9ecea4 /tools/testing/selftests/net/lib/py/utils.py | |
| parent | cpufreq/amd-pstate: Fix prefcore rankings (diff) | |
| download | kernel-857a61c2ce74e30fc3b10bc89d68ddd8d05b188c.tar.gz kernel-857a61c2ce74e30fc3b10bc89d68ddd8d05b188c.zip | |
cpufreq/amd-pstate: Refactor max frequency calculation
The previous approach introduced roundoff errors during division when
calculating the boost ratio. This, in turn, affected the maximum
frequency calculation, often resulting in reporting lower frequency
values.
For example, on the Glinda SoC based board with the following
parameters:
max_perf = 208
nominal_perf = 100
nominal_freq = 2600 MHz
The Linux kernel previously calculated the frequency as:
freq = ((max_perf * 1024 / nominal_perf) * nominal_freq) / 1024
freq = 5405 MHz // Integer arithmetic.
With the updated formula:
freq = (max_perf * nominal_freq) / nominal_perf
freq = 5408 MHz
This change ensures more accurate frequency calculations by eliminating
unnecessary shifts and divisions, thereby improving precision.
Signed-off-by: Naresh Solanki <[email protected]>
[ML: trim the changelog from commit message]
Reviewed-by: Mario Limonciello <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mario Limonciello <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
0 files changed, 0 insertions, 0 deletions
