From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: kristen.c.accardi@intel.com, rafael.j.wysocki@intel.com,
len.brown@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH 3/5] cpufreq: intel-pstate: Use separate max pstate for scaling
Date: Thu, 27 Aug 2015 04:43:19 -0700 [thread overview]
Message-ID: <1440675799.3108.6.camel@linux.intel.com> (raw)
In-Reply-To: <2064519.Kpvm97aGW8@vostro.rjw.lan>
On Thu, 2015-08-27 at 01:14 +0200, Rafael J. Wysocki wrote:
> On Wednesday, August 26, 2015 01:32:39 PM Srinivas Pandruvada wrote:
> > Systems with configurable TDP have multiple max non turbo p state.
> > Intel
> > P state uses max non turbo P state for scaling. But using the real
> > max
> > non turbo p state causes underestimation of next P state. So using
> > the physical max non turbo P state as before for scaling.
>
> What does "physical" mean here?
That is the max non turbo p state a particular processor family can
reach. For example a Broadwell client processor, the max non turbo P
state can be up to 0x17. This I am calling physical. May be not a good
choice of word?
OEMs may not want the non turbo P state to be this high and can reduce
by changing turbo activation ratio.
Thanks,
Srinivas
> > Signed-off-by: Srinivas Pandruvada <
> > srinivas.pandruvada@linux.intel.com>
> > ---
> > drivers/cpufreq/intel_pstate.c | 20 ++++++++++++++++++--
> > 1 file changed, 18 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 2641102..a349462 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -77,6 +77,7 @@ struct pstate_data {
> > int current_pstate;
> > int min_pstate;
> > int max_pstate;
> > + int max_pstate_physical;
> > int scaling;
> > int turbo_pstate;
> > u64 turbo_ratio_limit;
> > @@ -127,6 +128,7 @@ struct pstate_adjust_policy {
> >
> > struct pstate_funcs {
> > int (*get_max)(void);
> > + int (*get_max_physical)(void);
> > int (*get_min)(void);
> > int (*get_turbo)(void);
> > int (*get_scaling)(void);
> > @@ -599,6 +601,14 @@ static int core_get_min_pstate(void)
> > return (value >> 40) & 0xFF;
> > }
> >
> > +static int core_get_max_pstate_physical(void)
> > +{
> > + u64 value;
> > +
> > + rdmsrl(MSR_PLATFORM_INFO, value);
> > + return (value >> 8) & 0xFF;
> > +}
> > +
> > static int core_get_max_pstate(void)
> > {
> > u64 tar;
> > @@ -741,6 +751,7 @@ static struct cpu_defaults core_params = {
> > },
> > .funcs = {
> > .get_max = core_get_max_pstate,
> > + .get_max_physical = core_get_max_pstate_physical,
> > .get_min = core_get_min_pstate,
> > .get_turbo = core_get_turbo_pstate,
> > .get_scaling = core_get_scaling,
> > @@ -761,6 +772,7 @@ static struct cpu_defaults byt_params = {
> > },
> > .funcs = {
> > .get_max = byt_get_max_pstate,
> > + .get_max_physical = byt_get_max_pstate,
> > .get_min = byt_get_min_pstate,
> > .get_turbo = byt_get_turbo_pstate,
> > .set = byt_set_pstate,
> > @@ -780,6 +792,7 @@ static struct cpu_defaults knl_params = {
> > },
> > .funcs = {
> > .get_max = core_get_max_pstate,
> > + .get_max_physical = core_get_max_pstate_physical,
> > .get_min = core_get_min_pstate,
> > .get_turbo = knl_get_turbo_pstate,
> > .set = core_set_pstate,
> > @@ -833,6 +846,7 @@ static void intel_pstate_get_cpu_pstates(struct
> > cpudata *cpu)
> > {
> > cpu->pstate.min_pstate = pstate_funcs.get_min();
> > cpu->pstate.max_pstate = pstate_funcs.get_max();
> > + cpu->pstate.max_pstate_physical =
> > pstate_funcs.get_max_physical();
> > cpu->pstate.turbo_pstate = pstate_funcs.get_turbo();
> > cpu->pstate.scaling = pstate_funcs.get_scaling();
> > if (pstate_funcs.get_turbo_ratio_limit &&
> > @@ -854,7 +868,8 @@ static inline void
> > intel_pstate_calc_busy(struct cpudata *cpu)
> >
> > sample->freq = fp_toint(
> > mul_fp(int_tofp(
> > - cpu->pstate.max_pstate * cpu
> > ->pstate.scaling / 100),
> > + cpu->pstate.max_pstate_physical *
> > + cpu->pstate.scaling / 100),
> > core_pct));
> >
> > sample->core_pct_busy = (int32_t)core_pct;
> > @@ -922,7 +937,7 @@ static inline int32_t
> > intel_pstate_get_scaled_busy(struct cpudata *cpu)
> > * specified pstate.
> > */
> > core_busy = cpu->sample.core_pct_busy;
> > - max_pstate = int_tofp(cpu->pstate.max_pstate);
> > + max_pstate = int_tofp(cpu->pstate.max_pstate_physical);
> > current_pstate = int_tofp(cpu->pstate.current_pstate);
> > core_busy = mul_fp(core_busy, div_fp(max_pstate,
> > current_pstate));
> >
> > @@ -1215,6 +1230,7 @@ static void copy_pid_params(struct
> > pstate_adjust_policy *policy)
> > static void copy_cpu_funcs(struct pstate_funcs *funcs)
> > {
> > pstate_funcs.get_max = funcs->get_max;
> > + pstate_funcs.get_max_physical = funcs->get_max_physical;
> > pstate_funcs.get_min = funcs->get_min;
> > pstate_funcs.get_turbo = funcs->get_turbo;
> > pstate_funcs.get_scaling = funcs->get_scaling;
> >
>
next prev parent reply other threads:[~2015-08-27 11:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 20:32 [PATCH 0/5] Intel P states enhancements Srinivas Pandruvada
2015-08-26 20:32 ` [PATCH 1/5] cpufreq: intel_p_state: Fix limiting turbo sub states Srinivas Pandruvada
2015-08-26 20:32 ` [PATCH 2/5] cpufreq: intel_pstate: get P1 from TAR when available Srinivas Pandruvada
2015-08-26 20:32 ` [PATCH 3/5] cpufreq: intel-pstate: Use separate max pstate for scaling Srinivas Pandruvada
2015-08-26 23:14 ` Rafael J. Wysocki
2015-08-27 11:43 ` Srinivas Pandruvada [this message]
2015-08-26 20:32 ` [PATCH 4/5] cpufreq: intel_pstate: Use ACPI perf configuration Srinivas Pandruvada
2015-08-27 1:11 ` Rafael J. Wysocki
2015-08-27 12:08 ` Srinivas Pandruvada
2015-08-26 20:32 ` [PATCH 5/5] cpufreq: intel_pstate: Avoid calculation for max/min Srinivas Pandruvada
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=1440675799.3108.6.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=kristen.c.accardi@intel.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.