[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v6 00/19] amd-cppc CPU Performance Scaling Driver
amd-cppc 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_cppc driver has 2 operation modes: autonomous (active) mode, and non-autonomous (passive) mode. We register different CPUFreq driver for different modes, "amd-cppc" for passive mode and "amd-cppc-epp" for active mode. The passive mode leverages common governors such as *ondemand*, *performance*, etc, to manage the performance tuning. While 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 in hardware will automatically 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-cppc is enabled on passive mode with a top-level `cpufreq=amd-cppc` option, while users add extra `active` flag to select active mode. With `cpufreq=amd-cppc,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 580000 KHz Avg freq 580000 KHz Avg freq 580000 KHz Setting CPU in performance mode Sampling and Outputs: Avg freq 4640000 KHz Avg freq 4220000 KHz Avg freq 4640000 KHz Penny Zheng (19): xen/amd: introduce amd_process_freq() to get processor frequency tools: drop "has_num" condition check for cppc mode tools: optimize cpufreq average freq print x86/cpufreq: continue looping other than -EBUSY or successful return xen/cpufreq: refactor cmdline "cpufreq=xxx" xen/cpufreq: make _PSD info common cpufreq: rename "xen_cppc_para" to "xen_get_cppc_para" xen/cpufreq: rename cppc preset name to "XEN_SYSCTL_CPPC_SET_PRESET_ONDEMAND" xen/cpufreq: neglect unsupported-mode request from DOM0 xen/cpufreq: introduce new sub-hypercall to propagate CPPC data xen/x86: introduce "cpufreq=amd-cppc" xen cmdline and amd-cppc driver xen/cpufreq: implement amd-cppc driver for CPPC in passive mode xen/x86: implement amd-cppc-epp driver for CPPC in active mode xen/cpufreq: get performance policy from governor set via xenpm tools/cpufreq: introduce helper to deal with CPPC-related parameters xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-op xen/cpufreq: introduce helper cpufreq_in_cppc_passive_mode() xen/cpufreq: bypass governor-related para for amd-cppc-epp xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver docs/misc/xen-command-line.pandoc | 14 +- tools/include/xenctrl.h | 4 +- tools/libs/ctrl/xc_pm.c | 68 +- tools/misc/xenpm.c | 131 +++- xen/arch/x86/acpi/cpufreq/Makefile | 1 + xen/arch/x86/acpi/cpufreq/amd-cppc.c | 777 ++++++++++++++++++++++ xen/arch/x86/acpi/cpufreq/cpufreq.c | 74 ++- xen/arch/x86/acpi/cpufreq/hwp.c | 4 +- xen/arch/x86/cpu/amd.c | 58 +- xen/arch/x86/include/asm/amd.h | 2 + xen/arch/x86/include/asm/msr-index.h | 6 + xen/arch/x86/platform_hypercall.c | 26 +- xen/arch/x86/x86_64/cpufreq.c | 19 + xen/arch/x86/x86_64/platform_hypercall.c | 3 + xen/drivers/acpi/pm-op.c | 56 +- xen/drivers/acpi/pmstat.c | 3 + xen/drivers/cpufreq/cpufreq.c | 308 +++++++-- xen/drivers/cpufreq/utility.c | 15 + xen/include/acpi/cpufreq/cpufreq.h | 19 +- xen/include/acpi/cpufreq/processor_perf.h | 14 +- xen/include/public/platform.h | 26 + xen/include/public/sysctl.h | 29 +- xen/include/xen/pmstat.h | 5 + xen/include/xlat.lst | 1 + 24 files changed, 1522 insertions(+), 141 deletions(-) create mode 100644 xen/arch/x86/acpi/cpufreq/amd-cppc.c -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |