OSDN Git Service

x86, sched: Calculate frequency invariance for AMD systems
authorNathan Fontenot <nathan.fontenot@amd.com>
Thu, 12 Nov 2020 18:26:12 +0000 (19:26 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 11 Dec 2020 09:26:00 +0000 (10:26 +0100)
commit41ea667227bad5c247d76e6605054e96e4d95f51
tree87afaf0a16010034f3b38a8f4371b46dd0ab9a03
parenta787bdaff83a085288b6fc607afb4bb648da3cc9
x86, sched: Calculate frequency invariance for AMD systems

This is the first pass in creating the ability to calculate the
frequency invariance on AMD systems. This approach uses the CPPC
highest performance and nominal performance values that range from
0 - 255 instead of a high and base frquency. This is because we do
not have the ability on AMD to get a highest frequency value.

On AMD systems the highest performance and nominal performance
vaues do correspond to the highest and base frequencies for the system
so using them should produce an appropriate ratio but some tweaking
is likely necessary.

Due to CPPC being initialized later in boot than when the frequency
invariant calculation is currently made, I had to create a callback
from the CPPC init code to do the calculation after we have CPPC
data.

Special thanks to "kernel test robot <lkp@intel.com>" for reporting that
compilation of drivers/acpi/cppc_acpi.c is conditional to
CONFIG_ACPI_CPPC_LIB, not just CONFIG_ACPI.

[ ggherdovich@suse.cz: made safe under CPU hotplug, edited changelog. ]

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Signed-off-by: Giovanni Gherdovich <ggherdovich@suse.cz>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20201112182614.10700-2-ggherdovich@suse.cz
arch/x86/include/asm/topology.h
arch/x86/kernel/smpboot.c
drivers/acpi/cppc_acpi.c