All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Documentation <linux-doc@vger.kernel.org>
Subject: Re: [RFC][PATCH] cpufreq: User/admin documentation update and consolidation
Date: Tue, 21 Feb 2017 00:47:40 +0100	[thread overview]
Message-ID: <3286899.ZXTn8kPQWt@aspire.rjw.lan> (raw)
In-Reply-To: <4488503.27M9KJWnWE@aspire.rjw.lan>

On Monday, February 20, 2017 02:58:27 PM Rafael J. Wysocki wrote:
> On Monday, February 20, 2017 03:26:08 PM Viresh Kumar wrote:
> > On 18-02-17, 02:36, Rafael J. Wysocki wrote:
> > > +CPU Initialization
> > > +==================
> > > +
> > 
> > 
> > > +Next, the scaling driver's ``->init()`` callback is invoked with the policy
> > > +pointer of the new CPU passed to it as the argument.  If the policy object
> > > +pointed to by it is new
> > 
> > The callbacks don't need to do anything special for a new policy.
> > Infact, ->init() is only called for new policies or policies which
> > don't have any active CPUs as of now.
> 
> Yes, it is called for new and inactive policies.
> 
> For new policies it has to populate policy->cpus (because otherwise the core
> doesn't know what CPUs should be there), which quite arguably doesn't have
> to (or even doesn't need to) be done for inactive policies (because they already
> have policy->real_cpus and policy->related_cpus populated).
> 
> I would even argue that ->init() should not update policy->cpus for inactive
> (but not new) policies.
> 
> > > , that callback is expected to initialize the performance
> > > +scaling hardware interface for the given CPU (or, more precisely, for the set of
> > > +CPUs sharing the hardware interface it belongs to, represented by its policy
> > > +object) and to set parameters of the policy, like the minimum and maximum
> > > +frequencies supported by the hardware, the table of available frequencies (if
> > > +the set of supported P-states is not a continuous range), and the mask of CPUs
> > > +that belong to the same policy.
> > 
> > Maybe we should explicitly mention that both online and offline CPUs
> > should be set in the mask ?
> 
> I can do that.
> 
> But offline CPUs can only be set in that mask if the policy is actually new.

Well, drivers actually always set them, so let me put it differently.

It is not very useful to update a policy that previously was inactive from
->init(), because the related_cpus mask is only populated if the policy is new
and the symbolic links from CPU directories in sysfs to it are only created
once etc.

So it would be OK to skip updating the policy in ->init() in that case.

Thanks,
Rafael

  reply	other threads:[~2017-02-20 23:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18  1:36 [RFC][PATCH] cpufreq: User/admin documentation update and consolidation Rafael J. Wysocki
2017-02-20  9:56 ` Viresh Kumar
2017-02-20 13:58   ` Rafael J. Wysocki
2017-02-20 23:47     ` Rafael J. Wysocki [this message]
2017-02-21  5:00     ` Viresh Kumar
2017-02-22  0:50       ` Rafael J. Wysocki
2017-02-21  0:59 ` [RFC][PATCH v2] " 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=3286899.ZXTn8kPQWt@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --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 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.