AMD-GFX Archive mirror
 help / color / mirror / Atom feed
From: "Deucher, Alexander" <Alexander.Deucher@amd.com>
To: "Lazar, Lijo" <Lijo.Lazar@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Zhang, Hawking" <Hawking.Zhang@amd.com>,
	"Kamal, Asad" <Asad.Kamal@amd.com>, "Ma, Le" <Le.Ma@amd.com>
Subject: RE: [PATCH v3 10/10] Documentation/amdgpu: Add PM policy documentation
Date: Mon, 13 May 2024 21:36:13 +0000	[thread overview]
Message-ID: <BL1PR12MB5144BB418683EAFF6ACADBADF7E22@BL1PR12MB5144.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20240513092111.341168-11-lijo.lazar@amd.com>

[Public]

> -----Original Message-----
> From: Lazar, Lijo <Lijo.Lazar@amd.com>
> Sent: Monday, May 13, 2024 5:21 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Kamal, Asad <Asad.Kamal@amd.com>; Ma,
> Le <Le.Ma@amd.com>
> Subject: [PATCH v3 10/10] Documentation/amdgpu: Add PM policy
> documentation
>
> Add documentation about the newly added pm_policy node in sysfs.
>
> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
> ---
>  Documentation/gpu/amdgpu/thermal.rst |  6 ++++
>  drivers/gpu/drm/amd/pm/amdgpu_pm.c   | 48
> ++++++++++++++++++++++++++++
>  2 files changed, 54 insertions(+)
>
> diff --git a/Documentation/gpu/amdgpu/thermal.rst
> b/Documentation/gpu/amdgpu/thermal.rst
> index 2f6166f81e6a..6d942b5c58f0 100644
> --- a/Documentation/gpu/amdgpu/thermal.rst
> +++ b/Documentation/gpu/amdgpu/thermal.rst
> @@ -49,6 +49,12 @@ pp_power_profile_mode  .. kernel-doc::
> drivers/gpu/drm/amd/pm/amdgpu_pm.c
>     :doc: pp_power_profile_mode
>
> +pm_policy
> +---------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +   :doc: pm_policy
> +
>  \*_busy_percent
>  ---------------
>
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index 9cca4716ec43..45766d49f1f2 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -2214,6 +2214,54 @@ static int pp_dpm_clk_default_attr_update(struct
> amdgpu_device *adev, struct amd
>       return 0;
>  }
>
> +/**
> + * DOC: pm_policy
> + *
> + * Certain SOCs can support different power policies to optimize
> +application
> + * performance. However, this policy is provided only at SOC level and
> +not at a
> + * per-process level. This is useful especially when entire SOC is
> +utilized for
> + * dedicated workload.
> + *
> + * The amdgpu driver provides a sysfs API for selecting the policy.
> +Presently,
> + * only two types of policies are supported through this interface.
> + *
> + *  Pstate Policy Selection - This is to select different Pstate
> +profiles which
> + *  decides clock/throttling preferences.
> + *
> + *  XGMI PLPD Policy Selection - When multiple devices are connected
> +over XGMI,
> + *  this helps to select policy to be applied for per link power down.
> + *
> + * The list of available policies and policy levels vary between SOCs.
> +They can
> + * be viewed by reading the file. The policy level which is applied
> +presently is
> + * denoted by * (asterisk). E.g.,
> + *
> + * .. code-block:: console
> + *
> + *   cat /sys/bus/pci/devices/.../pm_policy
> + *   soc pstate
> + *   0 : soc_pstate_default
> + *   1 : soc_pstate_0
> + *   2 : soc_pstate_1*
> + *   3 : soc_pstate_2
> + *   xgmi plpd
> + *   0 : plpd_disallow
> + *   1 : plpd_default
> + *   2 : plpd_optimized*
> + *
> + * To apply a specific policy
> + *
> + * "echo <policy type> <level> > /sys/bus/pci/devices/.../pm_policy"
> + *
> + * For the levels listed in the example above, to select
> +"plpd_optimized" for
> + * XGMI and "soc_pstate_2" for soc pstate policy -
> + *
> + * .. code-block:: console
> + *
> + *   echo "xgmi 2" > /sys/bus/pci/devices/.../pm_policy
> + *   echo "soc_pstate 3" > /sys/bus/pci/devices/.../pm_policy

The naming should be consistent between what is printed when you read the file and what you write to it.  E.g., policy_type should be soc_pstate and xgmi_plpd in both cases.

Alex

> + *
> + */
> +
>  static ssize_t amdgpu_get_pm_policy(struct device *dev,
>                                   struct device_attribute *attr, char *buf)  {
> --
> 2.25.1


      reply	other threads:[~2024-05-13 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13  9:21 [PATCH v3 00/10] Add PM policy interfaces Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 01/10] drm/amd/pm: Add support for DPM policies Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 02/10] drm/amd/pm: Update PMFW messages for SMUv13.0.6 Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 03/10] drm/amd/pm: Add support to select pstate policy Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 04/10] drm/amd/pm: Add xgmi plpd policy to pm_policy Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 05/10] drm/amd/pm: Add xgmi plpd to SMU v13.0.6 pm_policy Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 06/10] drm/amd/pm: Add xgmi plpd to aldebaran pm_policy Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 07/10] drm/amd/pm: Add xgmi plpd to arcturus pm_policy Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 08/10] drm/amd/pm: Remove legacy interface for xgmi plpd Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 09/10] drm/amd/pm: Remove unused interface to set plpd Lijo Lazar
2024-05-13  9:21 ` [PATCH v3 10/10] Documentation/amdgpu: Add PM policy documentation Lijo Lazar
2024-05-13 21:36   ` Deucher, Alexander [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL1PR12MB5144BB418683EAFF6ACADBADF7E22@BL1PR12MB5144.namprd12.prod.outlook.com \
    --to=alexander.deucher@amd.com \
    --cc=Asad.Kamal@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Le.Ma@amd.com \
    --cc=Lijo.Lazar@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).