Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: intel-pstate: Use :ref: directive for internal linking

intel_pstate docs uses standard reST construct (`Section title`_) for
cross-referencing sections (internal linking), rather than for external
links. Incorrect cross-references are not caught when these are written
in that syntax, however (fortunately docutils 0.22 raise duplicate
target warnings that get fixed in cb908f8b0acc7e ("Documentation:
intel_pstate: fix duplicate hyperlink target errors")).

Convert the cross-references to use :ref: directive, which doesn't
exhibit this problem.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
[ rjw: Changelog tweak ]
Link: https://patch.msgid.link/20251101055614.32270-1-bagasdotme@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Bagas Sanjaya and committed by
Rafael J. Wysocki
4ab25c92 790e826b

+70 -63
+70 -63
Documentation/admin-guide/pm/intel_pstate.rst
··· 48 48 command line. However, its configuration can be adjusted via ``sysfs`` to a 49 49 great extent. In some configurations it even is possible to unregister it via 50 50 ``sysfs`` which allows another ``CPUFreq`` scaling driver to be loaded and 51 - registered (see `below <status_attr_>`_). 51 + registered (see :ref:`below <status_attr>`). 52 52 53 + .. _operation_modes: 53 54 54 55 Operation Modes 55 56 =============== ··· 63 62 depends on what kernel command line options are used and on the capabilities of 64 63 the processor. 65 64 66 - .. _Active Mode: 65 + .. _active_mode: 67 66 68 67 Active Mode 69 68 ----------- ··· 97 96 Namely, if that option is set, the ``performance`` algorithm will be used by 98 97 default, and the other one will be used by default if it is not set. 99 98 100 - .. _Active Mode With HWP: 99 + .. _active_mode_hwp: 101 100 102 101 Active Mode With HWP 103 102 ~~~~~~~~~~~~~~~~~~~~ ··· 128 127 internal P-state selection logic is expected to focus entirely on performance. 129 128 130 129 This will override the EPP/EPB setting coming from the ``sysfs`` interface 131 - (see `Energy vs Performance Hints`_ below). Moreover, any attempts to change 130 + (see :ref:`energy_performance_hints` below). Moreover, any attempts to change 132 131 the EPP/EPB to a value different from 0 ("performance") via ``sysfs`` in this 133 132 configuration will be rejected. 134 133 ··· 197 196 :c:macro:`CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE` kernel configuration option 198 197 is not set. 199 198 200 - .. _Passive Mode: 199 + .. _passive_mode: 201 200 202 201 Passive Mode 203 202 ------------ ··· 296 295 the entire range of available P-states, including the whole turbo range, to the 297 296 ``CPUFreq`` core and (in the passive mode) to generic scaling governors. This 298 297 generally causes turbo P-states to be set more often when ``intel_pstate`` is 299 - used relative to ACPI-based CPU performance scaling (see `below <acpi-cpufreq_>`_ 300 - for more information). 298 + used relative to ACPI-based CPU performance scaling (see 299 + :ref:`below <acpi-cpufreq>` for more information). 301 300 302 301 Moreover, since ``intel_pstate`` always knows what the real turbo threshold is 303 302 (even if the Configurable TDP feature is enabled in the processor), its 304 - ``no_turbo`` attribute in ``sysfs`` (described `below <no_turbo_attr_>`_) should 303 + ``no_turbo`` attribute in ``sysfs`` (described :ref:`below <no_turbo_attr>`) should 305 304 work as expected in all cases (that is, if set to disable turbo P-states, it 306 305 always should prevent ``intel_pstate`` from using them). 307 306 ··· 314 313 315 314 * The minimum supported P-state. 316 315 317 - * The maximum supported `non-turbo P-state <turbo_>`_. 316 + * The maximum supported :ref:`non-turbo P-state <turbo>`. 318 317 319 318 * Whether or not turbo P-states are supported at all. 320 319 321 - * The maximum supported `one-core turbo P-state <turbo_>`_ (if turbo P-states 322 - are supported). 320 + * The maximum supported :ref:`one-core turbo P-state <turbo>` (if turbo 321 + P-states are supported). 323 322 324 323 * The scaling formula to translate the driver's internal representation 325 324 of P-states into frequencies and the other way around. ··· 407 406 408 407 If ``CONFIG_ENERGY_MODEL`` has been set during kernel configuration and 409 408 ``intel_pstate`` runs on a hybrid processor without SMT, in addition to enabling 410 - `CAS <CAS_>`_ it registers an Energy Model for the processor. This allows the 409 + :ref:`CAS` it registers an Energy Model for the processor. This allows the 411 410 Energy-Aware Scheduling (EAS) support to be enabled in the CPU scheduler if 412 411 ``schedutil`` is used as the ``CPUFreq`` governor which requires ``intel_pstate`` 413 - to operate in the `passive mode <Passive Mode_>`_. 412 + to operate in the :ref:`passive mode <passive_mode>`. 414 413 415 414 The Energy Model registered by ``intel_pstate`` is artificial (that is, it is 416 415 based on abstract cost values and it does not include any real power numbers) ··· 439 438 User Space Interface in ``sysfs`` 440 439 ================================= 441 440 442 - .. _Global Attributes: 441 + .. _global_attributes: 443 442 444 443 Global Attributes 445 444 ----------------- ··· 453 452 454 453 ``max_perf_pct`` 455 454 Maximum P-state the driver is allowed to set in percent of the 456 - maximum supported performance level (the highest supported `turbo 457 - P-state <turbo_>`_). 455 + maximum supported performance level (the highest supported :ref:`turbo 456 + P-state <turbo>`). 458 457 459 458 This attribute will not be exposed if the 460 459 ``intel_pstate=per_cpu_perf_limits`` argument is present in the kernel ··· 462 461 463 462 ``min_perf_pct`` 464 463 Minimum P-state the driver is allowed to set in percent of the 465 - maximum supported performance level (the highest supported `turbo 466 - P-state <turbo_>`_). 464 + maximum supported performance level (the highest supported :ref:`turbo 465 + P-state <turbo>`). 467 466 468 467 This attribute will not be exposed if the 469 468 ``intel_pstate=per_cpu_perf_limits`` argument is present in the kernel ··· 472 471 ``num_pstates`` 473 472 Number of P-states supported by the processor (between 0 and 255 474 473 inclusive) including both turbo and non-turbo P-states (see 475 - `Turbo P-states Support`_). 474 + :ref:`turbo`). 476 475 477 476 This attribute is present only if the value exposed by it is the same 478 477 for all of the CPUs in the system. 479 478 480 479 The value of this attribute is not affected by the ``no_turbo`` 481 - setting described `below <no_turbo_attr_>`_. 480 + setting described :ref:`below <no_turbo_attr>`. 482 481 483 482 This attribute is read-only. 484 483 485 484 ``turbo_pct`` 486 - Ratio of the `turbo range <turbo_>`_ size to the size of the entire 485 + Ratio of the :ref:`turbo range <turbo>` size to the size of the entire 487 486 range of supported P-states, in percent. 488 487 489 488 This attribute is present only if the value exposed by it is the same ··· 495 494 496 495 ``no_turbo`` 497 496 If set (equal to 1), the driver is not allowed to set any turbo P-states 498 - (see `Turbo P-states Support`_). If unset (equal to 0, which is the 497 + (see :ref:`turbo`). If unset (equal to 0, which is the 499 498 default), turbo P-states can be set by the driver. 500 499 [Note that ``intel_pstate`` does not support the general ``boost`` 501 500 attribute (supported by some other scaling drivers) which is replaced ··· 504 503 This attribute does not affect the maximum supported frequency value 505 504 supplied to the ``CPUFreq`` core and exposed via the policy interface, 506 505 but it affects the maximum possible value of per-policy P-state limits 507 - (see `Interpretation of Policy Attributes`_ below for details). 506 + (see :ref:`policy_attributes_interpretation` below for details). 508 507 509 508 ``hwp_dynamic_boost`` 510 509 This attribute is only present if ``intel_pstate`` works in the 511 - `active mode with the HWP feature enabled <Active Mode With HWP_>`_ in 510 + :ref:`active mode with the HWP feature enabled <active_mode_hwp>` in 512 511 the processor. If set (equal to 1), it causes the minimum P-state limit 513 512 to be increased dynamically for a short time whenever a task previously 514 513 waiting on I/O is selected to run on a given logical CPU (the purpose ··· 523 522 Operation mode of the driver: "active", "passive" or "off". 524 523 525 524 "active" 526 - The driver is functional and in the `active mode 527 - <Active Mode_>`_. 525 + The driver is functional and in the :ref:`active mode 526 + <active_mode>`. 528 527 529 528 "passive" 530 - The driver is functional and in the `passive mode 531 - <Passive Mode_>`_. 529 + The driver is functional and in the :ref:`passive mode 530 + <passive_mode>`. 532 531 533 532 "off" 534 533 The driver is not functional (it is not registered as a scaling ··· 556 555 attribute to "1" enables the energy-efficiency optimizations and setting 557 556 to "0" disables them. 558 557 558 + .. _policy_attributes_interpretation: 559 + 559 560 Interpretation of Policy Attributes 560 561 ----------------------------------- 561 562 562 563 The interpretation of some ``CPUFreq`` policy attributes described in 563 564 Documentation/admin-guide/pm/cpufreq.rst is special with ``intel_pstate`` 564 565 as the current scaling driver and it generally depends on the driver's 565 - `operation mode <Operation Modes_>`_. 566 + :ref:`operation mode <operation_modes>`. 566 567 567 568 First of all, the values of the ``cpuinfo_max_freq``, ``cpuinfo_min_freq`` and 568 569 ``scaling_cur_freq`` attributes are produced by applying a processor-specific ··· 573 570 attributes are capped by the frequency corresponding to the maximum P-state that 574 571 the driver is allowed to set. 575 572 576 - If the ``no_turbo`` `global attribute <no_turbo_attr_>`_ is set, the driver is 577 - not allowed to use turbo P-states, so the maximum value of ``scaling_max_freq`` 578 - and ``scaling_min_freq`` is limited to the maximum non-turbo P-state frequency. 573 + If the ``no_turbo`` :ref:`global attribute <no_turbo_attr>` is set, the driver 574 + is not allowed to use turbo P-states, so the maximum value of 575 + ``scaling_max_freq`` and ``scaling_min_freq`` is limited to the maximum 576 + non-turbo P-state frequency. 579 577 Accordingly, setting ``no_turbo`` causes ``scaling_max_freq`` and 580 578 ``scaling_min_freq`` to go down to that value if they were above it before. 581 579 However, the old values of ``scaling_max_freq`` and ``scaling_min_freq`` will be ··· 588 584 which also is the value of ``cpuinfo_max_freq`` in either case. 589 585 590 586 Next, the following policy attributes have special meaning if 591 - ``intel_pstate`` works in the `active mode <Active Mode_>`_: 587 + ``intel_pstate`` works in the :ref:`active mode <active_mode>`: 592 588 593 589 ``scaling_available_governors`` 594 590 List of P-state selection algorithms provided by ``intel_pstate``. ··· 609 605 Shows the base frequency of the CPU. Any frequency above this will be 610 606 in the turbo frequency range. 611 607 612 - The meaning of these attributes in the `passive mode <Passive Mode_>`_ is the 608 + The meaning of these attributes in the :ref:`passive mode <passive_mode>` is the 613 609 same as for other scaling drivers. 614 610 615 611 Additionally, the value of the ``scaling_driver`` attribute for ``intel_pstate`` 616 612 depends on the operation mode of the driver. Namely, it is either 617 - "intel_pstate" (in the `active mode <Active Mode_>`_) or "intel_cpufreq" (in the 618 - `passive mode <Passive Mode_>`_). 613 + "intel_pstate" (in the :ref:`active mode <active_mode>`) or "intel_cpufreq" 614 + (in the :ref:`passive mode <passive_mode>`). 615 + 616 + .. _pstate_limits_coordination: 619 617 620 618 Coordination of P-State Limits 621 619 ------------------------------ 622 620 623 621 ``intel_pstate`` allows P-state limits to be set in two ways: with the help of 624 - the ``max_perf_pct`` and ``min_perf_pct`` `global attributes 625 - <Global Attributes_>`_ or via the ``scaling_max_freq`` and ``scaling_min_freq`` 622 + the ``max_perf_pct`` and ``min_perf_pct`` :ref:`global attributes 623 + <global_attributes>` or via the ``scaling_max_freq`` and ``scaling_min_freq`` 626 624 ``CPUFreq`` policy attributes. The coordination between those limits is based 627 625 on the following rules, regardless of the current operation mode of the driver: 628 626 ··· 646 640 647 641 3. The global and per-policy limits can be set independently. 648 642 649 - In the `active mode with the HWP feature enabled <Active Mode With HWP_>`_, the 643 + In the :ref:`active mode with the HWP feature enabled <active_mode_hwp>`, the 650 644 resulting effective values are written into hardware registers whenever the 651 645 limits change in order to request its internal P-state selection logic to always 652 646 set P-states within these limits. Otherwise, the limits are taken into account 653 - by scaling governors (in the `passive mode <Passive Mode_>`_) and by the driver 654 - every time before setting a new P-state for a CPU. 647 + by scaling governors (in the :ref:`passive mode <passive_mode>`) and by the 648 + driver every time before setting a new P-state for a CPU. 655 649 656 650 Additionally, if the ``intel_pstate=per_cpu_perf_limits`` command line argument 657 651 is passed to the kernel, ``max_perf_pct`` and ``min_perf_pct`` are not exposed 658 652 at all and the only way to set the limits is by using the policy attributes. 659 653 654 + .. _energy_performance_hints: 660 655 661 656 Energy vs Performance Hints 662 657 --------------------------- ··· 717 710 On those systems each ``_PSS`` object returns a list of P-states supported by 718 711 the corresponding CPU which basically is a subset of the P-states range that can 719 712 be used by ``intel_pstate`` on the same system, with one exception: the whole 720 - `turbo range <turbo_>`_ is represented by one item in it (the topmost one). By 721 - convention, the frequency returned by ``_PSS`` for that item is greater by 1 MHz 722 - than the frequency of the highest non-turbo P-state listed by it, but the 713 + :ref:`turbo range <turbo>` is represented by one item in it (the topmost one). 714 + By convention, the frequency returned by ``_PSS`` for that item is greater by 715 + 1 MHz than the frequency of the highest non-turbo P-state listed by it, but the 723 716 corresponding P-state representation (following the hardware specification) 724 717 returned for it matches the maximum supported turbo P-state (or is the 725 718 special value 255 meaning essentially "go as high as you can get"). ··· 745 738 instead. 746 739 747 740 One more issue related to that may appear on systems supporting the 748 - `Configurable TDP feature <turbo_>`_ allowing the platform firmware to set the 749 - turbo threshold. Namely, if that is not coordinated with the lists of P-states 750 - returned by ``_PSS`` properly, there may be more than one item corresponding to 751 - a turbo P-state in those lists and there may be a problem with avoiding the 752 - turbo range (if desirable or necessary). Usually, to avoid using turbo 753 - P-states overall, ``acpi-cpufreq`` simply avoids using the topmost state listed 754 - by ``_PSS``, but that is not sufficient when there are other turbo P-states in 755 - the list returned by it. 741 + :ref:`Configurable TDP feature <turbo>` allowing the platform firmware to set 742 + the turbo threshold. Namely, if that is not coordinated with the lists of 743 + P-states returned by ``_PSS`` properly, there may be more than one item 744 + corresponding to a turbo P-state in those lists and there may be a problem with 745 + avoiding the turbo range (if desirable or necessary). Usually, to avoid using 746 + turbo P-states overall, ``acpi-cpufreq`` simply avoids using the topmost state 747 + listed by ``_PSS``, but that is not sufficient when there are other turbo 748 + P-states in the list returned by it. 756 749 757 750 Apart from the above, ``acpi-cpufreq`` works like ``intel_pstate`` in the 758 - `passive mode <Passive Mode_>`_, except that the number of P-states it can set 759 - is limited to the ones listed by the ACPI ``_PSS`` objects. 751 + :ref:`passive mode <passive_mode>`, except that the number of P-states it can 752 + set is limited to the ones listed by the ACPI ``_PSS`` objects. 760 753 761 754 762 755 Kernel Command Line Options for ``intel_pstate`` ··· 771 764 processor is supported by it. 772 765 773 766 ``active`` 774 - Register ``intel_pstate`` in the `active mode <Active Mode_>`_ to start 775 - with. 767 + Register ``intel_pstate`` in the :ref:`active mode <active_mode>` to 768 + start with. 776 769 777 770 ``passive`` 778 - Register ``intel_pstate`` in the `passive mode <Passive Mode_>`_ to 771 + Register ``intel_pstate`` in the :ref:`passive mode <passive_mode>` to 779 772 start with. 780 773 781 774 ``force`` ··· 808 801 and this option has no effect. 809 802 810 803 ``per_cpu_perf_limits`` 811 - Use per-logical-CPU P-State limits (see `Coordination of P-state 812 - Limits`_ for details). 804 + Use per-logical-CPU P-State limits (see 805 + :ref:`pstate_limits_coordination` for details). 813 806 814 807 ``no_cas`` 815 - Do not enable `capacity-aware scheduling <CAS_>`_ which is enabled by 816 - default on hybrid systems without SMT. 808 + Do not enable :ref:`capacity-aware scheduling <CAS>` which is enabled 809 + by default on hybrid systems without SMT. 817 810 818 811 Diagnostics and Tuning 819 812 ====================== ··· 825 818 diagnostics. One of them is the ``cpu_frequency`` trace event generally used 826 819 by ``CPUFreq``, and the other one is the ``pstate_sample`` trace event specific 827 820 to ``intel_pstate``. Both of them are triggered by ``intel_pstate`` only if 828 - it works in the `active mode <Active Mode_>`_. 821 + it works in the :ref:`active mode <active_mode>`. 829 822 830 823 The following sequence of shell commands can be used to enable them and see 831 824 their output (if the kernel is generally configured to support event tracing):: ··· 837 830 gnome-terminal--4510 [001] ..s. 1177.680733: pstate_sample: core_busy=107 scaled=94 from=26 to=26 mperf=1143818 aperf=1230607 tsc=29838618 freq=2474476 838 831 cat-5235 [002] ..s. 1177.681723: cpu_frequency: state=2900000 cpu_id=2 839 832 840 - If ``intel_pstate`` works in the `passive mode <Passive Mode_>`_, the 833 + If ``intel_pstate`` works in the :ref:`passive mode <passive_mode>`, the 841 834 ``cpu_frequency`` trace event will be triggered either by the ``schedutil`` 842 835 scaling governor (for the policies it is attached to), or by the ``CPUFreq`` 843 836 core (for the policies with other scaling governors).