Skip to content

Commit 3b65dd5

Browse files
committed
Merge branch 'pm-docs'
Merge additional power management documentation udates for 5.18-rc1: - Add Intel uncore frequency scaling documentation file to its MAINTAINERS entry (Srinivas Pandruvada). - Clean up the AMD P-state driver documentation (Jan Engelhardt). * pm-docs: Documentation: amd-pstate: grammar and sentence structure updates MAINTAINERS: Add additional file to uncore frequency control
2 parents 79bc8bf + 7000ef3 commit 3b65dd5

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
lines changed

Documentation/admin-guide/pm/amd-pstate.rst

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Linux kernel. The new mechanism is based on Collaborative Processor
1919
Performance Control (CPPC) which provides finer grain frequency management
2020
than legacy ACPI hardware P-States. Current AMD CPU/APU platforms are using
2121
the ACPI P-states driver to manage CPU frequency and clocks with switching
22-
only in 3 P-states. CPPC replaces the ACPI P-states controls, allows a
22+
only in 3 P-states. CPPC replaces the ACPI P-states controls and allows a
2323
flexible, low-latency interface for the Linux kernel to directly
2424
communicate the performance hints to hardware.
2525

2626
``amd-pstate`` leverages the Linux kernel governors such as ``schedutil``,
2727
``ondemand``, etc. to manage the performance hints which are provided by
2828
CPPC hardware functionality that internally follows the hardware
2929
specification (for details refer to AMD64 Architecture Programmer's Manual
30-
Volume 2: System Programming [1]_). Currently ``amd-pstate`` supports basic
30+
Volume 2: System Programming [1]_). Currently, ``amd-pstate`` supports basic
3131
frequency control function according to kernel governors on some of the
3232
Zen2 and Zen3 processors, and we will implement more AMD specific functions
3333
in future after we verify them on the hardware and SBIOS.
@@ -41,9 +41,9 @@ continuous, abstract, and unit-less performance value in a scale that is
4141
not tied to a specific performance state / frequency. This is an ACPI
4242
standard [2]_ which software can specify application performance goals and
4343
hints as a relative target to the infrastructure limits. AMD processors
44-
provides the low latency register model (MSR) instead of AML code
44+
provide the low latency register model (MSR) instead of an AML code
4545
interpreter for performance adjustments. ``amd-pstate`` will initialize a
46-
``struct cpufreq_driver`` instance ``amd_pstate_driver`` with the callbacks
46+
``struct cpufreq_driver`` instance, ``amd_pstate_driver``, with the callbacks
4747
to manage each performance update behavior. ::
4848

4949
Highest Perf ------>+-----------------------+ +-----------------------+
@@ -91,26 +91,26 @@ AMD CPPC Performance Capability
9191
Highest Performance (RO)
9292
.........................
9393

94-
It is the absolute maximum performance an individual processor may reach,
94+
This is the absolute maximum performance an individual processor may reach,
9595
assuming ideal conditions. This performance level may not be sustainable
9696
for long durations and may only be achievable if other platform components
97-
are in a specific state; for example, it may require other processors be in
97+
are in a specific state; for example, it may require other processors to be in
9898
an idle state. This would be equivalent to the highest frequencies
9999
supported by the processor.
100100

101101
Nominal (Guaranteed) Performance (RO)
102102
......................................
103103

104-
It is the maximum sustained performance level of the processor, assuming
105-
ideal operating conditions. In absence of an external constraint (power,
106-
thermal, etc.) this is the performance level the processor is expected to
104+
This is the maximum sustained performance level of the processor, assuming
105+
ideal operating conditions. In the absence of an external constraint (power,
106+
thermal, etc.), this is the performance level the processor is expected to
107107
be able to maintain continuously. All cores/processors are expected to be
108108
able to sustain their nominal performance state simultaneously.
109109

110110
Lowest non-linear Performance (RO)
111111
...................................
112112

113-
It is the lowest performance level at which nonlinear power savings are
113+
This is the lowest performance level at which nonlinear power savings are
114114
achieved, for example, due to the combined effects of voltage and frequency
115115
scaling. Above this threshold, lower performance levels should be generally
116116
more energy efficient than higher performance levels. This register
@@ -119,7 +119,7 @@ effectively conveys the most efficient performance level to ``amd-pstate``.
119119
Lowest Performance (RO)
120120
........................
121121

122-
It is the absolute lowest performance level of the processor. Selecting a
122+
This is the absolute lowest performance level of the processor. Selecting a
123123
performance level lower than the lowest nonlinear performance level may
124124
cause an efficiency penalty but should reduce the instantaneous power
125125
consumption of the processor.
@@ -149,14 +149,14 @@ a relative number. This can be expressed as percentage of nominal
149149
performance (infrastructure max). Below the nominal sustained performance
150150
level, desired performance expresses the average performance level of the
151151
processor subject to hardware. Above the nominal performance level,
152-
processor must provide at least nominal performance requested and go higher
152+
the processor must provide at least nominal performance requested and go higher
153153
if current operating conditions allow.
154154

155155
Energy Performance Preference (EPP) (RW)
156156
.........................................
157157

158-
Provides a hint to the hardware if software wants to bias toward performance
159-
(0x0) or energy efficiency (0xff).
158+
This attribute provides a hint to the hardware if software wants to bias
159+
toward performance (0x0) or energy efficiency (0xff).
160160

161161

162162
Key Governors Support
@@ -173,35 +173,34 @@ operating frequencies supported by the hardware. Users can check the
173173
``amd-pstate`` mainly supports ``schedutil`` and ``ondemand`` for dynamic
174174
frequency control. It is to fine tune the processor configuration on
175175
``amd-pstate`` to the ``schedutil`` with CPU CFS scheduler. ``amd-pstate``
176-
registers adjust_perf callback to implement the CPPC similar performance
177-
update behavior. It is initialized by ``sugov_start`` and then populate the
178-
CPU's update_util_data pointer to assign ``sugov_update_single_perf`` as
179-
the utilization update callback function in CPU scheduler. CPU scheduler
180-
will call ``cpufreq_update_util`` and assign the target performance
181-
according to the ``struct sugov_cpu`` that utilization update belongs to.
182-
Then ``amd-pstate`` updates the desired performance according to the CPU
176+
registers the adjust_perf callback to implement performance update behavior
177+
similar to CPPC. It is initialized by ``sugov_start`` and then populates the
178+
CPU's update_util_data pointer to assign ``sugov_update_single_perf`` as the
179+
utilization update callback function in the CPU scheduler. The CPU scheduler
180+
will call ``cpufreq_update_util`` and assigns the target performance according
181+
to the ``struct sugov_cpu`` that the utilization update belongs to.
182+
Then, ``amd-pstate`` updates the desired performance according to the CPU
183183
scheduler assigned.
184184

185185

186186
Processor Support
187187
=======================
188188

189-
The ``amd-pstate`` initialization will fail if the _CPC in ACPI SBIOS is
190-
not existed at the detected processor, and it uses ``acpi_cpc_valid`` to
191-
check the _CPC existence. All Zen based processors support legacy ACPI
192-
hardware P-States function, so while the ``amd-pstate`` fails to be
193-
initialized, the kernel will fall back to initialize ``acpi-cpufreq``
194-
driver.
189+
The ``amd-pstate`` initialization will fail if the ``_CPC`` entry in the ACPI
190+
SBIOS does not exist in the detected processor. It uses ``acpi_cpc_valid``
191+
to check the existence of ``_CPC``. All Zen based processors support the legacy
192+
ACPI hardware P-States function, so when ``amd-pstate`` fails initialization,
193+
the kernel will fall back to initialize the ``acpi-cpufreq`` driver.
195194

196195
There are two types of hardware implementations for ``amd-pstate``: one is
197196
`Full MSR Support <perf_cap_>`_ and another is `Shared Memory Support
198-
<perf_cap_>`_. It can use :c:macro:`X86_FEATURE_CPPC` feature flag (for
199-
details refer to Processor Programming Reference (PPR) for AMD Family
200-
19h Model 51h, Revision A1 Processors [3]_) to indicate the different
201-
types. ``amd-pstate`` is to register different ``static_call`` instances
202-
for different hardware implementations.
197+
<perf_cap_>`_. It can use the :c:macro:`X86_FEATURE_CPPC` feature flag to
198+
indicate the different types. (For details, refer to the Processor Programming
199+
Reference (PPR) for AMD Family 19h Model 51h, Revision A1 Processors [3]_.)
200+
``amd-pstate`` is to register different ``static_call`` instances for different
201+
hardware implementations.
203202

204-
Currently, some of Zen2 and Zen3 processors support ``amd-pstate``. In the
203+
Currently, some of the Zen2 and Zen3 processors support ``amd-pstate``. In the
205204
future, it will be supported on more and more AMD processors.
206205

207206
Full MSR Support
@@ -210,18 +209,18 @@ Full MSR Support
210209
Some new Zen3 processors such as Cezanne provide the MSR registers directly
211210
while the :c:macro:`X86_FEATURE_CPPC` CPU feature flag is set.
212211
``amd-pstate`` can handle the MSR register to implement the fast switch
213-
function in ``CPUFreq`` that can shrink latency of frequency control on the
214-
interrupt context. The functions with ``pstate_xxx`` prefix represent the
215-
operations of MSR registers.
212+
function in ``CPUFreq`` that can reduce the latency of frequency control in
213+
interrupt context. The functions with a ``pstate_xxx`` prefix represent the
214+
operations on MSR registers.
216215

217216
Shared Memory Support
218217
----------------------
219218

220-
If :c:macro:`X86_FEATURE_CPPC` CPU feature flag is not set, that means the
221-
processor supports shared memory solution. In this case, ``amd-pstate``
219+
If the :c:macro:`X86_FEATURE_CPPC` CPU feature flag is not set, the
220+
processor supports the shared memory solution. In this case, ``amd-pstate``
222221
uses the ``cppc_acpi`` helper methods to implement the callback functions
223-
that defined on ``static_call``. The functions with ``cppc_xxx`` prefix
224-
represent the operations of acpi cppc helpers for shared memory solution.
222+
that are defined on ``static_call``. The functions with the ``cppc_xxx`` prefix
223+
represent the operations of ACPI CPPC helpers for the shared memory solution.
225224

226225

227226
AMD P-States and ACPI hardware P-States always can be supported in one
@@ -234,7 +233,7 @@ User Space Interface in ``sysfs``
234233
==================================
235234

236235
``amd-pstate`` exposes several global attributes (files) in ``sysfs`` to
237-
control its functionality at the system level. They located in the
236+
control its functionality at the system level. They are located in the
238237
``/sys/devices/system/cpu/cpufreq/policyX/`` directory and affect all CPUs. ::
239238

240239
root@hr-test1:/home/ray# ls /sys/devices/system/cpu/cpufreq/policy0/*amd*
@@ -246,38 +245,38 @@ control its functionality at the system level. They located in the
246245
``amd_pstate_highest_perf / amd_pstate_max_freq``
247246

248247
Maximum CPPC performance and CPU frequency that the driver is allowed to
249-
set in percent of the maximum supported CPPC performance level (the highest
248+
set, in percent of the maximum supported CPPC performance level (the highest
250249
performance supported in `AMD CPPC Performance Capability <perf_cap_>`_).
251-
In some of ASICs, the highest CPPC performance is not the one in the _CPC
252-
table, so we need to expose it to sysfs. If boost is not active but
253-
supported, this maximum frequency will be larger than the one in
250+
In some ASICs, the highest CPPC performance is not the one in the ``_CPC``
251+
table, so we need to expose it to sysfs. If boost is not active, but
252+
still supported, this maximum frequency will be larger than the one in
254253
``cpuinfo``.
255254
This attribute is read-only.
256255

257256
``amd_pstate_lowest_nonlinear_freq``
258257

259-
The lowest non-linear CPPC CPU frequency that the driver is allowed to set
260-
in percent of the maximum supported CPPC performance level (Please see the
258+
The lowest non-linear CPPC CPU frequency that the driver is allowed to set,
259+
in percent of the maximum supported CPPC performance level. (Please see the
261260
lowest non-linear performance in `AMD CPPC Performance Capability
262-
<perf_cap_>`_).
261+
<perf_cap_>`_.)
263262
This attribute is read-only.
264263

265-
For other performance and frequency values, we can read them back from
264+
Other performance and frequency values can be read back from
266265
``/sys/devices/system/cpu/cpuX/acpi_cppc/``, see :ref:`cppc_sysfs`.
267266

268267

269268
``amd-pstate`` vs ``acpi-cpufreq``
270269
======================================
271270

272-
On majority of AMD platforms supported by ``acpi-cpufreq``, the ACPI tables
273-
provided by the platform firmware used for CPU performance scaling, but
274-
only provides 3 P-states on AMD processors.
275-
However, on modern AMD APU and CPU series, it provides the collaborative
276-
processor performance control according to ACPI protocol and customize this
277-
for AMD platforms. That is fine-grain and continuous frequency range
271+
On the majority of AMD platforms supported by ``acpi-cpufreq``, the ACPI tables
272+
provided by the platform firmware are used for CPU performance scaling, but
273+
only provide 3 P-states on AMD processors.
274+
However, on modern AMD APU and CPU series, hardware provides the Collaborative
275+
Processor Performance Control according to the ACPI protocol and customizes this
276+
for AMD platforms. That is, fine-grained and continuous frequency ranges
278277
instead of the legacy hardware P-states. ``amd-pstate`` is the kernel
279-
module which supports the new AMD P-States mechanism on most of future AMD
280-
platforms. The AMD P-States mechanism will be the more performance and energy
278+
module which supports the new AMD P-States mechanism on most of the future AMD
279+
platforms. The AMD P-States mechanism is the more performance and energy
281280
efficiency frequency management method on AMD processors.
282281

283282
Kernel Module Options for ``amd-pstate``
@@ -287,25 +286,25 @@ Kernel Module Options for ``amd-pstate``
287286
Use a module param (shared_mem) to enable related processors manually with
288287
**amd_pstate.shared_mem=1**.
289288
Due to the performance issue on the processors with `Shared Memory Support
290-
<perf_cap_>`_, so we disable it for the moment and will enable this by default
291-
once we address performance issue on this solution.
289+
<perf_cap_>`_, we disable it presently and will re-enable this by default
290+
once we address performance issue with this solution.
292291

293-
The way to check whether current processor is `Full MSR Support <perf_cap_>`_
292+
To check whether the current processor is using `Full MSR Support <perf_cap_>`_
294293
or `Shared Memory Support <perf_cap_>`_ : ::
295294

296295
ray@hr-test1:~$ lscpu | grep cppc
297296
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
298297

299-
If CPU Flags have cppc, then this processor supports `Full MSR Support
300-
<perf_cap_>`_. Otherwise it supports `Shared Memory Support <perf_cap_>`_.
298+
If the CPU flags have ``cppc``, then this processor supports `Full MSR Support
299+
<perf_cap_>`_. Otherwise, it supports `Shared Memory Support <perf_cap_>`_.
301300

302301

303302
``cpupower`` tool support for ``amd-pstate``
304303
===============================================
305304

306-
``amd-pstate`` is supported on ``cpupower`` tool that can be used to dump the frequency
307-
information. And it is in progress to support more and more operations for new
308-
``amd-pstate`` module with this tool. ::
305+
``amd-pstate`` is supported by the ``cpupower`` tool, which can be used to dump
306+
frequency information. Development is in progress to support more and more
307+
operations for the new ``amd-pstate`` module with this tool. ::
309308

310309
root@hr-test1:/home/ray# cpupower frequency-info
311310
analyzing CPU 0:
@@ -336,10 +335,10 @@ Trace Events
336335
--------------
337336

338337
There are two static trace events that can be used for ``amd-pstate``
339-
diagnostics. One of them is the cpu_frequency trace event generally used
338+
diagnostics. One of them is the ``cpu_frequency`` trace event generally used
340339
by ``CPUFreq``, and the other one is the ``amd_pstate_perf`` trace event
341340
specific to ``amd-pstate``. The following sequence of shell commands can
342-
be used to enable them and see their output (if the kernel is generally
341+
be used to enable them and see their output (if the kernel is
343342
configured to support event tracing). ::
344343

345344
root@hr-test1:/home/ray# cd /sys/kernel/tracing/
@@ -364,7 +363,7 @@ configured to support event tracing). ::
364363
<idle>-0 [003] d.s.. 4995.980971: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=3 changed=false fast_switch=true
365364
<idle>-0 [011] d.s.. 4995.980996: amd_pstate_perf: amd_min_perf=85 amd_des_perf=85 amd_max_perf=166 cpu_id=11 changed=false fast_switch=true
366365

367-
The cpu_frequency trace event will be triggered either by the ``schedutil`` scaling
366+
The ``cpu_frequency`` trace event will be triggered either by the ``schedutil`` scaling
368367
governor (for the policies it is attached to), or by the ``CPUFreq`` core (for the
369368
policies with other scaling governors).
370369

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9921,6 +9921,7 @@ INTEL UNCORE FREQUENCY CONTROL
99219921
M: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
99229922
L: platform-driver-x86@vger.kernel.org
99239923
S: Maintained
9924+
F: Documentation/admin-guide/pm/intel_uncore_frequency_scaling.rst
99249925
F: drivers/platform/x86/intel/uncore-frequency.c
99259926

99269927
INTEL VENDOR SPECIFIC EXTENDED CAPABILITIES DRIVER

0 commit comments

Comments
 (0)