hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/admin-guide/pm/cpufreq.rst
....@@ -1,13 +1,16 @@
1
-.. |struct cpufreq_policy| replace:: :c:type:`struct cpufreq_policy <cpufreq_policy>`
1
+.. SPDX-License-Identifier: GPL-2.0
2
+.. include:: <isonum.txt>
3
+
24 .. |intel_pstate| replace:: :doc:`intel_pstate <intel_pstate>`
35
46 =======================
57 CPU Performance Scaling
68 =======================
79
8
-::
10
+:Copyright: |copy| 2017 Intel Corporation
911
10
- Copyright (c) 2017 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
12
+:Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
13
+
1114
1215 The Concept of CPU Performance Scaling
1316 ======================================
....@@ -88,16 +91,16 @@
8891 all of those CPUs simultaneously.
8992
9093 Sets of CPUs sharing hardware P-state control interfaces are represented by
91
-``CPUFreq`` as |struct cpufreq_policy| objects. For consistency,
92
-|struct cpufreq_policy| is also used when there is only one CPU in the given
94
+``CPUFreq`` as struct cpufreq_policy objects. For consistency,
95
+struct cpufreq_policy is also used when there is only one CPU in the given
9396 set.
9497
95
-The ``CPUFreq`` core maintains a pointer to a |struct cpufreq_policy| object for
98
+The ``CPUFreq`` core maintains a pointer to a struct cpufreq_policy object for
9699 every CPU in the system, including CPUs that are currently offline. If multiple
97100 CPUs share the same hardware P-state control interface, all of the pointers
98
-corresponding to them point to the same |struct cpufreq_policy| object.
101
+corresponding to them point to the same struct cpufreq_policy object.
99102
100
-``CPUFreq`` uses |struct cpufreq_policy| as its basic data type and the design
103
+``CPUFreq`` uses struct cpufreq_policy as its basic data type and the design
101104 of its user space interface is based on the policy concept.
102105
103106
....@@ -143,14 +146,14 @@
143146
144147 The next major initialization step for a new policy object is to attach a
145148 scaling governor to it (to begin with, that is the default scaling governor
146
-determined by the kernel configuration, but it may be changed later
147
-via ``sysfs``). First, a pointer to the new policy object is passed to the
148
-governor's ``->init()`` callback which is expected to initialize all of the
149
+determined by the kernel command line or configuration, but it may be changed
150
+later via ``sysfs``). First, a pointer to the new policy object is passed to
151
+the governor's ``->init()`` callback which is expected to initialize all of the
149152 data structures necessary to handle the given policy and, possibly, to add
150153 a governor ``sysfs`` interface to it. Next, the governor is started by
151154 invoking its ``->start()`` callback.
152155
153
-That callback it expected to register per-CPU utilization update callbacks for
156
+That callback is expected to register per-CPU utilization update callbacks for
154157 all of the online CPUs belonging to the given policy with the CPU scheduler.
155158 The utilization update callbacks will be invoked by the CPU scheduler on
156159 important events, like task enqueue and dequeue, on every iteration of the
....@@ -396,8 +399,8 @@
396399 the allowed maximum (that is, the ``scaling_max_freq`` policy limit). In turn,
397400 if it is invoked by the CFS scheduling class, the governor will use the
398401 Per-Entity Load Tracking (PELT) metric for the root control group of the
399
-given CPU as the CPU utilization estimate (see the `Per-entity load tracking`_
400
-LWN.net article for a description of the PELT mechanism). Then, the new
402
+given CPU as the CPU utilization estimate (see the *Per-entity load tracking*
403
+LWN.net article [1]_ for a description of the PELT mechanism). Then, the new
401404 CPU frequency to apply is computed in accordance with the formula
402405
403406 f = 1.25 * ``f_0`` * ``util`` / ``max``
....@@ -756,4 +759,8 @@
756759 :c:macro:`CONFIG_X86_ACPI_CPUFREQ_CPB` configuration option is set.
757760
758761
759
-.. _Per-entity load tracking: https://lwn.net/Articles/531853/
762
+References
763
+==========
764
+
765
+.. [1] Jonathan Corbet, *Per-entity load tracking*,
766
+ https://lwn.net/Articles/531853/