linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ionela Voinescu <ionela.voinescu@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rjw@rjwysocki.net, sudeep.holla@arm.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq,cppc: fix issue when hotplugging out policy->cpu
Date: Fri, 4 Sep 2020 10:43:03 +0100	[thread overview]
Message-ID: <20200904094303.GA10031@arm.com> (raw)
In-Reply-To: <20200904050604.yoar2c6fofcikipp@vireshk-i7>

Hi Viresh,

On Friday 04 Sep 2020 at 10:36:04 (+0530), Viresh Kumar wrote:
[..]
> >  /* Per CPU container for runtime CPPC management. */
> >  struct cppc_cpudata {
> > -	int cpu;
> >  	struct cppc_perf_caps perf_caps;
> >  	struct cppc_perf_ctrls perf_ctrls;
> >  	struct cppc_perf_fb_ctrs perf_fb_ctrs;
> 
> With the way things are designed, I believe this is one of the bugs
> out of many.
> 
> The structure cppc_cpudata must be shared across all CPUs of the same
> policy, so they all end up using the same set of values for different
> variables. i.e. it shouldn't be a per-cpu thing at all. Just allocate
> it from cpufreq_driver->init and store in policy->driver_data for use
> elsewhere.
> 
> That would be a proper fix IMO, we just avoided one of the bugs here
> otherwise.
> 

Do you know why it was designed this way in the first place?

I assumed it was designed like this (per-cpu cppc_cpudata structures) to
allow for the future addition of support for the HW_ALL CPPC coordination
type. In that case you can still have PSD (dependency) domains but the
desired performance controls would be per-cpu, with the coordination
done in hardware/firmware. So, in the HW_ALL case you'd end up having
different performance controls even for CPUs in the same policy.
Currently the CPPC driver only supports SW_ANY which is the traditional
cpufreq approach.

Thanks,
Ionela.


> -- 
> viresh

  reply	other threads:[~2020-09-04  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 11:19 [PATCH] cpufreq,cppc: fix issue when hotplugging out policy->cpu Ionela Voinescu
2020-09-04  5:06 ` Viresh Kumar
2020-09-04  9:43   ` Ionela Voinescu [this message]
2020-09-07  6:11     ` Viresh Kumar
2020-09-22 16:25       ` Ionela Voinescu

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=20200904094303.GA10031@arm.com \
    --to=ionela.voinescu@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.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 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).