linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [Update][PATCH 1/2] cpufreq: intel_pstate: Per CPU P-State limits
Date: Wed, 12 Oct 2016 17:45:10 -0700	[thread overview]
Message-ID: <1476319510.30002.14.camel@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0hWeNwf9ZNmKVo9MebjsFyN-XNQ9oBjuMD6=L=4VTG-Yg@mail.gmail.com>

On Thu, 2016-10-13 at 02:34 +0200, Rafael J. Wysocki wrote:
> On Thu, Oct 13, 2016 at 2:16 AM, Rafael J. Wysocki <rafael@kernel.org
> > wrote:
> > 
> > On Thu, Oct 13, 2016 at 1:16 AM, Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com> wrote:
> > > 
> > > Hi,
> > > 
> > > On Thu, 2016-10-13 at 00:26 +0200, Rafael J. Wysocki wrote:
> > > 
> > > [...]
> > > 
> > > > 
> > > > 
> > > > I have a couple of comments to the details, but let me start
> > > > with a
> > > > high-level view.
> > > > I would do this quite differently.  There is quite a bit of a
> > > > headache with
> > > > keeping the global settings (intel_pstate/max(min)_perf_pct)
> > > > and the
> > > > per-policy
> > > > scaling_max(min)_freq in sync and I'm not sure this really is
> > > > necessary.
> > > > Moreover, all of these updates are asynchronous with respect to
> > > > the
> > > > scheduler
> > > > callback anyway, so there are races this synchronization
> > > > between the
> > > > settings
> > > > doesn't cover.  IMO, it would be sufficient to combine the two
> > > > in
> > > > intel_pstate_get_min_max() only where the limits to apply for
> > > > the
> > > > given CPU are
> > > > computed.
> > > > 
> > > > So if limits->max_sysfs_perf is there (in addition to or even
> > > > instead
> > > > of
> > > > limits->max_sysfs_pct), intel_pstate_get_min_max() can be
> > > > something
> > > > like:
> > > Idea is to preserve current functionality.
> > > 
> > > The problem with approach is that limits are changed via cpufreq
> > > sysfs,
> > > the intel_pstate sysfs doesn't reflect that. This is the value it
> > > is
> > > displaying currently so keeping the same functionality.
> > > 
> > > Currently we know from Intel P-state sysfs the limited
> > > performance
> > > value irrespective of which sysfs did. So I don't want to break
> > > this
> > > behavior (There are tools reading intel_pstate sysfs for current
> > > limits
> > > to get to next quickly to meet thermal deadline, also cpufreq
> > > sysfs
> > > limits can change without tools knowledge by say thermal or _PPC,
> > > so
> > > the intel P-state sysfs is a common place now).
> > Sigh.  OK
> > 
> > Why don't we update the effective min and max (stored in static
> > variables) when (a) the global sysfs is written to and (b) on
> > updates
> > via ->set_policy()?
> Bad idea.
> 
> But it looks like the effective min and max only need to be computed
> in the "show" routines before returning them.
The other place is just to check error during set max/min_perf_pct via
sysfs. Want to avoid store bad limits stored.

Thanks,
Srinivas


  reply	other threads:[~2016-10-13  0:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 19:07 [Update][PATCH 1/2] cpufreq: intel_pstate: Per CPU P-State limits Srinivas Pandruvada
2016-10-12 22:26 ` Rafael J. Wysocki
2016-10-12 23:16   ` Srinivas Pandruvada
2016-10-13  0:16     ` Rafael J. Wysocki
2016-10-13  0:34       ` Rafael J. Wysocki
2016-10-13  0:45         ` Srinivas Pandruvada [this message]
2016-10-13  0:55           ` Rafael J. Wysocki

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=1476319510.30002.14.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).