diff mbox series

[v5,11/13] cpufreq/amd-pstate: Disable preferred cores on designs with workload classification

Message ID 20241028020251.8085-12-mario.limonciello@amd.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series Add support for AMD hardware feedback interface | expand

Commit Message

Mario Limonciello Oct. 28, 2024, 2:02 a.m. UTC
On designs that have workload classification, it's preferred that
the amd-hfi driver is used to provide hints to the scheduler of
which cores to use instead of the amd-pstate driver.

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Yuan, Perry Oct. 28, 2024, 7:56 a.m. UTC | #1
[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Monday, October 28, 2024 10:03 AM
> To: Borislav Petkov <bp@alien8.de>; Hans de Goede <hdegoede@redhat.com>;
> Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> Cc: x86@kernel.org; Shenoy, Gautham Ranjal <gautham.shenoy@amd.com>;
> Limonciello, Mario <Mario.Limonciello@amd.com>; Yuan, Perry
> <Perry.Yuan@amd.com>; linux-kernel@vger.kernel.org; linux-doc@vger.kernel.org;
> linux-pm@vger.kernel.org; platform-driver-x86@vger.kernel.org; S-k, Shyam-
> sundar <Shyam-sundar.S-k@amd.com>
> Subject: [PATCH v5 11/13] cpufreq/amd-pstate: Disable preferred cores on designs
> with workload classification
>
> On designs that have workload classification, it's preferred that the amd-hfi driver is
> used to provide hints to the scheduler of which cores to use instead of the amd-
> pstate driver.
>
> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index
> 32ddbf37a9f0a..c60cc84866982 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -780,6 +780,12 @@ static void amd_pstate_init_prefcore(struct amd_cpudata
> *cpudata)
>       /* user disabled or not detected */
>       if (!amd_pstate_prefcore)
>               return;
> +     /* should use amd-hfi instead */
> +     if (boot_cpu_has(X86_FEATURE_AMD_WORKLOAD_CLASS) &&
> +         IS_ENABLED(CONFIG_AMD_HFI)) {
> +             amd_pstate_prefcore = false;
> +             return;
> +     }
>
>       cpudata->hw_prefcore = true;
>
> --
> 2.43.0

LGTM, the legacy prefer core need to be disabled when HFI loaded.

Reviewed-by: Perry Yuan <perry.yuan@amd.com>
diff mbox series

Patch

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 32ddbf37a9f0a..c60cc84866982 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -780,6 +780,12 @@  static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata)
 	/* user disabled or not detected */
 	if (!amd_pstate_prefcore)
 		return;
+	/* should use amd-hfi instead */
+	if (boot_cpu_has(X86_FEATURE_AMD_WORKLOAD_CLASS) &&
+	    IS_ENABLED(CONFIG_AMD_HFI)) {
+		amd_pstate_prefcore = false;
+		return;
+	}
 
 	cpudata->hw_prefcore = true;