RE: [PATCH v4 10/10] Documentation/amdgpu: Add PM policy documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Lazar, Lijo <Lijo.Lazar@xxxxxxx>
> Sent: Tuesday, May 14, 2024 7:06 AM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Zhang, Hawking <Hawking.Zhang@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>; Kamal, Asad <Asad.Kamal@xxxxxxx>; Ma,
> Le <Le.Ma@xxxxxxx>
> Subject: [PATCH v4 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@xxxxxxx>
> ---
>  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 5c92c041d0bc..be39276181a1 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*

I think it would be cleaner to have a pm_policy directory and then have soc_pstate and xgmi_plpd has nodes within that directory.  That aligns better with the sysfs model and makes it easier to expose different policy options for different SoCs.

Alex


> + *
> + * 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_plpd 2" > /sys/bus/pci/devices/.../pm_policy
> + *   echo "soc_pstate 3" > /sys/bus/pci/devices/.../pm_policy
> + *
> + */
> +
>  static ssize_t amdgpu_get_pm_policy(struct device *dev,
>                                   struct device_attribute *attr, char *buf)  {
> --
> 2.25.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux