[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1 00/11] amd-pstate CPU Performance Scaling Driver
amd-pstate is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on modern AMD APU and CPU series in Xen. The new mechanism is based on Collaborative Processor Performance Control (CPPC) which provides finer grain frequency management than legacy ACPI hardware P-States. Current AMD CPU/APU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. CPPC replaces the ACPI P-states controls and allows a flexible, low-latency interface for Xen to directly communicate the performance hints to hardware. amd_pstate CPPC has 2 operation modes: autonomous (active) mode, and non-autonomous (passive) mode. We register different CPUFreq driver for different modes, "amd-pstate" for passive mode and "amd-pstate-epp" for active mode. The passive mode leverages common governors such as *ondemand*, *performance*, etc, to manage the performance hints. And the active mode uses epp to provides a hint to the hardware if software wants to bias toward performance (0x0) or energy efficiency (0xff). CPPC power algorithm will calculate the runtime workload and adjust the realtime cpu cores frequency according to the power supply and thermal, core voltage and some other hardware conditions. amd-pstate is enabled with a top-level cpufreq=amd-pstate option. It will fallback to cpufreq=xen if amd-pstate is unavailable. With `cpufreq=amd-pstate,active`, We did a 60s sampling test to see the CPU frequency change, through tweaking the energy_perf preference from `xenpm set-cpufreq-cppc powersave` to `xenpm set-cpufreq-cppc performance`. The outputs are as follows: ``` Setting CPU in powersave mode Sampling and Outputs: Avg freq 2000000 KHz Avg freq 2000000 KHz Avg freq 2000000 KHz Setting CPU in performance mode Sampling and Outputs: Avg freq 4640000 KHz Avg freq 4220000 KHz Avg freq 4640000 KHz ``` Penny Zheng (11): xen/x86: add CPPC feature flag for AMD processors xen/x86: introduce new sub-hypercall to get CPPC data xen/x86: introduce "cpufreq=amd-pstate" xen cmdline xen/x86: get processor max speed from DMI table xen/x86: introduce a new amd pstate driver for cpufreq scaling xen/cpufreq: introduce policy type when cpufreq_driver->setpolicy exists xen/cpufreq: only set gov NULL when cpufreq_driver.target() exists x86/cpufreq: add "cpufreq=amd-pstate,active" para xen/x86: implement EPP support for the AMD processors tools/xenpm: Print CPPC parameters for amd-pstate driver xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-pstate driver docs/misc/xen-command-line.pandoc | 15 +- tools/misc/xenpm.c | 19 +- xen/arch/x86/acpi/cpufreq/Makefile | 1 + xen/arch/x86/acpi/cpufreq/amd-pstate.c | 641 ++++++++++++++++++++ xen/arch/x86/acpi/cpufreq/cpufreq.c | 28 + xen/arch/x86/acpi/cpufreq/hwp.c | 10 +- xen/arch/x86/dmi_scan.c | 19 + xen/arch/x86/include/asm/cpufeature.h | 1 + xen/arch/x86/include/asm/msr-index.h | 5 + xen/arch/x86/platform_hypercall.c | 12 + xen/arch/x86/x86_64/cpufreq.c | 18 + xen/arch/x86/x86_64/platform_hypercall.c | 3 + xen/drivers/acpi/pmstat.c | 24 +- xen/drivers/cpufreq/cpufreq.c | 71 ++- xen/drivers/cpufreq/utility.c | 11 + xen/include/acpi/cpufreq/cpufreq.h | 27 + xen/include/acpi/cpufreq/processor_perf.h | 1 + xen/include/public/arch-x86/cpufeatureset.h | 1 + xen/include/public/platform.h | 12 + xen/include/public/sysctl.h | 3 +- xen/include/xen/dmi.h | 5 + xen/include/xen/pmstat.h | 3 + xen/include/xlat.lst | 1 + 23 files changed, 910 insertions(+), 21 deletions(-) create mode 100644 xen/arch/x86/acpi/cpufreq/amd-pstate.c -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |