public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: Re: [PATCH] cpufreq: conservative: Do not use transition notifications
Date: Mon, 13 Jun 2016 16:38:51 +0530	[thread overview]
Message-ID: <20160613110851.GT27439@vireshk-i7> (raw)
In-Reply-To: <2899343.d3UcWvo4TA@vostro.rjw.lan>

On 10-06-16, 03:00, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> The conservative governor registers a transition notifier so it
> can update its internal requested_freq value if it falls out of the
> policy->min...policy->max range, but that's not the most
> straightforward way to achieve that.
> 
> To do it in a more straightforward way, first make sure that
> cs_dbs_timer() will only set frequencies between min and max.
> 
> With that, note that requested_freq will always fall between min
> and max unless either policy->min or policy->max changes and the
> governor's ->limits() callback will be invoked then.
> 
> Using this observation, add a ->limits callback pointer to
> struct dbs_governor, make cpufreq_dbs_governor_limits() invoke
> that callback if present, implement that callback in the conservative
> governor to update requested_freq if needed and drop the transition
> notifier from it, which also makes it possible to drop the
> struct cs_governor definition from there and simplify the code
> accordingly.

This code looks to me over-complicated and I am not sure if I
understand why we wanted the notifiers anyway? Why can't we replace
'dbs_info->requested_freq' with 'policy->cur' and kill the notifier
thing completely?

With requested_freq, we are trying to set the next freq to
requested_freq +- Delta, which I am not sure is the best approach
here.

What would go wrong if we will do, policy->cur +- delta instead?

The notifiers were added long back, to solve a problem which I don't
think will exist if we use policy->cur everywhere instead:

commit a8d7c3bc2396 ("[CPUFREQ] Make cpufreq_conservative handle
out-of-sync events properly")

Am I missing something?

-- 
viresh

  reply	other threads:[~2016-06-13 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10  1:00 [PATCH] cpufreq: conservative: Do not use transition notifications Rafael J. Wysocki
2016-06-13 11:08 ` Viresh Kumar [this message]
2016-06-13 13:36   ` Rafael J. Wysocki
2016-06-13 15:28     ` Viresh Kumar
2016-06-13 20:57       ` 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=20160613110851.GT27439@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --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