public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Fontenot <nafonten@amd.com>
To: Perry Yuan <Perry.Yuan@amd.com>,
	rafael.j.wysocki@intel.com, viresh.kumar@linaro.org,
	Ray.Huang@amd.com, "Rafael J. Wysocki" <rafael@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Deepak.Sharma@amd.com, Mario.Limonciello@amd.com,
	Nathan.Fontenot@amd.com, Alexander.Deucher@amd.com,
	Jinzhou.Su@amd.com, Xinmei.Huang@amd.com, Xiaojian.Du@amd.com,
	Li.Meng@amd.com
Subject: Re: [PATCH 07/12] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor
Date: Thu, 7 Jul 2022 14:56:58 -0500	[thread overview]
Message-ID: <c25cbc3f-11c6-aca6-af7d-a4d7aa91e1ae@amd.com> (raw)
In-Reply-To: <20220707170022.216202-1-Perry.Yuan@amd.com>

On 7/7/22 12:00, Perry Yuan wrote:
> The patch will fix the invalid desired perf value for powersave
> governor. This issue is found when testing on one AMD EPYC system, the
> actual des_perf is smaller than the min_perf value, that is invalid
> value. because the min_perf is the lowest_perf system can support in
> idle state.
> 
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 7c51f4125263..154eed849f38 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -317,6 +317,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy,
>  	des_perf = DIV_ROUND_CLOSEST(target_freq * cap_perf,
>  				     cpudata->max_freq);
>  
> +	des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
>  	cpufreq_freq_transition_begin(policy, &freqs);
>  	amd_pstate_update(cpudata, min_perf, des_perf,
>  			  max_perf, false);

The clamping of the desired perf value should be moved to amd_pstate_update(). The
only other caller of amd_pstate_update() is amd_pstate_adjust_perf() which already
clamps the desired perf value before making the call.

-Nathan

  reply	other threads:[~2022-07-07 19:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 17:00 [PATCH 07/12] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Perry Yuan
2022-07-07 19:56 ` Nathan Fontenot [this message]
2022-07-09  8:49   ` Yuan, Perry

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=c25cbc3f-11c6-aca6-af7d-a4d7aa91e1ae@amd.com \
    --to=nafonten@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Deepak.Sharma@amd.com \
    --cc=Jinzhou.Su@amd.com \
    --cc=Li.Meng@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=Xinmei.Huang@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.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