linux-yocto/arch/riscv
Vincent Guittot 46db6d4797 sched/topology: Add a new arch_scale_freq_ref() method
commit 9942cb22ea upstream.

Create a new method to get a unique and fixed max frequency. Currently
cpuinfo.max_freq or the highest (or last) state of performance domain are
used as the max frequency when computing the frequency for a level of
utilization, but:

  - cpuinfo_max_freq can change at runtime. boost is one example of
    such change.

  - cpuinfo.max_freq and last item of the PD can be different leading to
    different results between cpufreq and energy model.

We need to save the reference frequency that has been used when computing
the CPUs capacity and use this fixed and coherent value to convert between
frequency and CPU's capacity.

In fact, we already save the frequency that has been used when computing
the capacity of each CPU. We extend the precision to save kHz instead of
MHz currently and we modify the type to be aligned with other variables
used when converting frequency to capacity and the other way.

[ mingo: Minor edits. ]

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20231211104855.558096-2-vincent.guittot@linaro.org
Stable-dep-of: e37617c8e5 ("sched/fair: Fix frequency selection for non-invariant case")
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:28:42 +02:00
..
boot riscv: dts: starfive: Fix a typo in StarFive JH7110 pin function definitions 2025-03-28 21:59:54 +01:00
configs
errata RISC-V: errata: Use medany for relocatable builds 2025-04-10 14:37:39 +02:00
include sched/topology: Add a new arch_scale_freq_ref() method 2025-08-28 16:28:42 +02:00
kernel riscv: Pass patch_text() the length in bytes 2025-05-09 09:44:03 +02:00
kvm RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs 2025-06-27 11:09:04 +01:00
lib
mm riscv: Fix hugetlb retrieval of number of ptes in case of !present pte 2025-04-10 14:37:39 +02:00
net riscv: Pass patch_text() the length in bytes 2025-05-09 09:44:03 +02:00
purgatory riscv/purgatory: align riscv_kernel_entry 2024-11-14 13:19:38 +01:00
tools
Kbuild
Kconfig
Kconfig.debug
Kconfig.errata
Kconfig.socs
Makefile
Makefile.postlink