public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH] cpufreq: intel_pstate: Simplify intel_pstate_update_perf_limits()
Date: Fri, 9 Apr 2021 20:01:57 +0800	[thread overview]
Message-ID: <20210409120157.GA229488@chenyu-desktop> (raw)
In-Reply-To: <5450142.DvuYhMxLoT@kreacher>

On Wed, Apr 07, 2021 at 04:21:55PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Because pstate.max_freq is always equal to the product of
> pstate.max_pstate and pstate.scaling and, analogously,
> pstate.turbo_freq is always equal to the product of
> pstate.turbo_pstate and pstate.scaling, the result of the
> max_policy_perf computation in intel_pstate_update_perf_limits() is
> always equal to the quotient of policy_max and pstate.scaling,
> regardless of whether or not turbo is disabled.  Analogously, the
> result of min_policy_perf in intel_pstate_update_perf_limits() is
> always equal to the quotient of policy_min and pstate.scaling.
> 
> Accordingly, intel_pstate_update_perf_limits() need not check
> whether or not turbo is enabled at all and in order to compute
> max_policy_perf and min_policy_perf it can always divide policy_max
> and policy_min, respectively, by pstate.scaling.  Make it do so.
> 
> While at it, move the definition and initialization of the
> turbo_max local variable to the code branch using it.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Tested-by: Chen Yu <yu.c.chen@intel.com>

      reply	other threads:[~2021-04-09 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 14:21 [PATCH] cpufreq: intel_pstate: Simplify intel_pstate_update_perf_limits() Rafael J. Wysocki
2021-04-09 12:01 ` Chen Yu [this message]

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=20210409120157.GA229488@chenyu-desktop \
    --to=yu.c.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.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