lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJG+Xhun1Ltw9ox/@amd.com>
Date:   Tue, 20 Jun 2023 22:58:14 +0800
From:   Huang Rui <ray.huang@....com>
To:     "Yuan, Perry" <Perry.Yuan@....com>
Cc:     "rafael.j.wysocki@...el.com" <rafael.j.wysocki@...el.com>,
        "viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
        "Limonciello, Mario" <Mario.Limonciello@....com>,
        "Sharma, Deepak" <Deepak.Sharma@....com>,
        "Karny, Wyes" <Wyes.Karny@....com>,
        "Shenoy, Gautham Ranjal" <gautham.shenoy@....com>,
        "Li, Sun peng (Leo)" <Sunpeng.Li@....com>,
        "Huang, Shimmer" <Shimmer.Huang@....com>,
        "Du, Xiaojian" <Xiaojian.Du@....com>,
        "Meng, Li (Jassmine)" <Li.Meng@....com>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/4] cpufreq: amd-pstate: Set a fallback policy based
 on preferred_profile

On Thu, Jun 15, 2023 at 02:32:25PM +0800, Yuan, Perry wrote:
> From: Mario Limonciello <mario.limonciello@....com>
> 
> If a user's configuration doesn't explicitly specify the cpufreq
> scaling governor then the code currently explicitly falls back to
> 'powersave'. This default is fine for notebooks and desktops, but

May I know if the processor is powerful desktop such as threadripper,
whether it will be default to 'performance' or 'powersave'?

Thanks,
Ray

> servers and undefined machines should default to 'performance'.
> 
> Look at the 'preferred_profile' field from the FADT to set this
> policy accordingly.
> 
> Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt
> Suggested-by: Wyes Karny <Wyes.Karny@....com>
> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@....com>
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> ---
>  drivers/cpufreq/amd-pstate.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index ddd346a239e0..c9d296ebf81e 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1102,10 +1102,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>  	policy->max = policy->cpuinfo.max_freq;
>  
>  	/*
> -	 * Set the policy to powersave to provide a valid fallback value in case
> +	 * Set the policy to provide a valid fallback value in case
>  	 * the default cpufreq governor is neither powersave nor performance.
>  	 */
> -	policy->policy = CPUFREQ_POLICY_POWERSAVE;
> +	if (acpi_pm_profile_server() || acpi_pm_profile_undefined())
> +		policy->policy = CPUFREQ_POLICY_PERFORMANCE;
> +	else
> +		policy->policy = CPUFREQ_POLICY_POWERSAVE;
>  
>  	if (boot_cpu_has(X86_FEATURE_CPPC)) {
>  		ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value);
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ