From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Perry Yuan <perry.yuan@amd.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>,
"Artem S . Tashkinov" <aros@gmx.com>
Subject: Re: [PATCH v2 15/16] cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen
Date: Mon, 9 Dec 2024 14:57:58 +0530 [thread overview]
Message-ID: <Z1a4HuUug8+4nSYp@BLRRASHENOY1.amd.com> (raw)
In-Reply-To: <20241208063031.3113-16-mario.limonciello@amd.com>
On Sun, Dec 08, 2024 at 12:30:30AM -0600, Mario Limonciello wrote:
> For Ryzen systems the EPP policy set by the BIOS is generally configured
> to performance as this is the default register value for the CPPC request
> MSR.
>
> If a user doesn't use additional software to configure EPP then the system
> will default biased towards performance and consume extra battery. Instead
> configure the default to "balanced_performance" for this case.
>
> Suggested-by: Artem S. Tashkinov <aros@gmx.com>
> Reviewed-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
> Tested-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219526
> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Looks good to me for EPYC.
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
--
Thanks and Regards
gautham.
> ---
> drivers/cpufreq/amd-pstate.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 5869bcd287e87..a4ededb8d89df 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1501,8 +1501,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>
> policy->driver_data = cpudata;
>
> - cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata);
> -
> policy->min = policy->cpuinfo.min_freq;
> policy->max = policy->cpuinfo.max_freq;
>
> @@ -1513,10 +1511,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
> * the default cpufreq governor is neither powersave nor performance.
> */
> if (amd_pstate_acpi_pm_profile_server() ||
> - amd_pstate_acpi_pm_profile_undefined())
> + amd_pstate_acpi_pm_profile_undefined()) {
> policy->policy = CPUFREQ_POLICY_PERFORMANCE;
> - else
> + cpudata->epp_default = amd_pstate_get_epp(cpudata);
> + } else {
> policy->policy = CPUFREQ_POLICY_POWERSAVE;
> + cpudata->epp_default = AMD_CPPC_EPP_BALANCE_PERFORMANCE;
> + }
>
> if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
> ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value);
> @@ -1529,6 +1530,9 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
> return ret;
> WRITE_ONCE(cpudata->cppc_cap1_cached, value);
> }
> + ret = amd_pstate_set_epp(cpudata, cpudata->epp_default);
> + if (ret)
> + return ret;
>
> current_pstate_driver->adjust_perf = NULL;
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-12-09 9:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-08 6:30 [PATCH v2 00/16] amd-pstate fixes and improvements for 6.14 Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 01/16] cpufreq/amd-pstate: Store the boost numerator as highest perf again Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 02/16] cpufreq/amd-pstate: Use boost numerator for upper bound of frequencies Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 03/16] cpufreq/amd-pstate: Add trace event for EPP perf updates Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 04/16] cpufreq/amd-pstate: convert mutex use to guard() Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 05/16] cpufreq/amd-pstate: Drop cached epp_policy variable Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 06/16] cpufreq/amd-pstate: Use FIELD_PREP and FIELD_GET macros Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 07/16] cpufreq/amd-pstate: Only update the cached value in msr_set_epp() on success Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 08/16] cpufreq/amd-pstate: store all values in cpudata struct in khz Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 09/16] cpufreq/amd-pstate: Change amd_pstate_update_perf() to return an int Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 10/16] cpufreq/amd-pstate: Move limit updating code Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 11/16] cpufreq/amd-pstate: Cache EPP value and use that everywhere Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 12/16] cpufreq/amd-pstate: Always write EPP value when updating perf Mario Limonciello
2024-12-09 8:42 ` Gautham R. Shenoy
2024-12-09 16:49 ` Mario Limonciello
2024-12-09 17:15 ` Mario Limonciello
2024-12-10 11:10 ` Gautham R. Shenoy
2024-12-08 6:30 ` [PATCH v2 13/16] cpufreq/amd-pstate: Check if CPPC request has changed before writing to the MSR or shared memory Mario Limonciello
2024-12-09 8:56 ` Gautham R. Shenoy
2024-12-09 16:41 ` Mario Limonciello
2024-12-08 6:30 ` [PATCH v2 14/16] cpufreq/amd-pstate: Drop ret variable from amd_pstate_set_energy_pref_index() Mario Limonciello
2024-12-09 9:25 ` Gautham R. Shenoy
2024-12-08 6:30 ` [PATCH v2 15/16] cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen Mario Limonciello
2024-12-09 9:27 ` Gautham R. Shenoy [this message]
2024-12-08 6:30 ` [PATCH v2 16/16] cpufreq/amd-pstate: Drop boost_state variable Mario Limonciello
2024-12-09 10:24 ` Gautham R. Shenoy
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=Z1a4HuUug8+4nSYp@BLRRASHENOY1.amd.com \
--to=gautham.shenoy@amd.com \
--cc=Dhananjay.Ugwekar@amd.com \
--cc=aros@gmx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
/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