public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
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 22:57:35 +0200	[thread overview]
Message-ID: <3863285.5KT0E88Y5I@vostro.rjw.lan> (raw)
In-Reply-To: <20160613152834.GZ27439@vireshk-i7>

On Monday, June 13, 2016 08:58:34 PM Viresh Kumar wrote:
> On 13-06-16, 15:36, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Subject: [PATCH v2] cpufreq: conservative: Do not use transition notifications
> > 
> > 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 requested_freq is not really
> > necessary.
> > 
> > That value is used to track the frequency requested by the governor
> > previously, but policy->cur can be used instead of it and then the
> > governor will not have to worry about updating the tracked value when
> > the current frequency changes independently (for example, as a result
> > of min or max changes).
> > 
> > Accodringly, drop requested_freq from struct cs_policy_dbs_info
> > and modify cs_dbs_timer() to use policy->cur instead of it.
> > While at it, notice that __cpufreq_driver_target() clamps its
> > target_freq argument between policy->min and policy->max, so
> > the callers of it don't have to do that and make additional
> > changes in cs_dbs_timer() in accordance with that.
> > 
> > After these changes the transition notifier used by the conservative
> > governor is not necessary any more, so drop it, which also makes it
> > possible to drop the struct cs_governor definition and simplify the
> > code accordingly.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/cpufreq/cpufreq_conservative.c |  103 ++++++---------------------------
> >  1 file changed, 21 insertions(+), 82 deletions(-)
> > 
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks!

> > -static struct cs_governor cs_gov = {
> > -	.dbs_gov = {
> > -		.gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"),
> > -		.kobj_type = { .default_attrs = cs_attributes },
> > -		.gov_dbs_timer = cs_dbs_timer,
> > -		.alloc = cs_alloc,
> > -		.free = cs_free,
> > -		.init = cs_init,
> > -		.exit = cs_exit,
> > -		.start = cs_start,
> > -	},
> > +static struct dbs_governor cs_governor = {
> > +	.gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"),
> > +	.kobj_type = { .default_attrs = cs_attributes },
> > +	.gov_dbs_timer = cs_dbs_timer,
> > +	.alloc = cs_alloc,
> > +	.free = cs_free,
> > +	.init = cs_init,
> > +	.exit = cs_exit,
> > +	.start = cs_start,
> >  };
> 
> Though, I am not sure why this change was required :)

This is because struct cs_governor is not necessary any more, since its only
member, usage_count, was only needed because of the notifier.  So dbs_governor
can be used directly here now.

Thanks,
Rafael


      reply	other threads:[~2016-06-13 20:53 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
2016-06-13 13:36   ` Rafael J. Wysocki
2016-06-13 15:28     ` Viresh Kumar
2016-06-13 20:57       ` Rafael J. Wysocki [this message]

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=3863285.5KT0E88Y5I@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox