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: Steve Muckle <steve.muckle@linaro.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	Shawn Guo <shawn.guo@freescale.com>,
	Steven Miao <realmz6@gmail.com>
Subject: Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order
Date: Mon, 06 Jun 2016 14:10:26 +0200	[thread overview]
Message-ID: <1649758.V7uyzAJShK@vostro.rjw.lan> (raw)
In-Reply-To: <20160606035231.GZ16176@vireshk-i7>

On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote:
> On 03-06-16, 16:48, Steve Muckle wrote:
> > On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote:
> > ...
> > > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy,
> > >  	struct acpi_cpufreq_data *data = policy->driver_data;
> > >  	struct acpi_processor_performance *perf;
> > >  	struct cpufreq_frequency_table *entry;
> > > -	unsigned int next_perf_state, next_freq, freq;
> > > +	unsigned int next_perf_state, next_freq, index;
> > >  
> > >  	/*
> > >  	 * Find the closest frequency above target_freq.
> > > -	 *
> > > -	 * The table is sorted in the reverse order with respect to the
> > > -	 * frequency and all of the entries are valid (see the initialization).
> > >  	 */
> > > -	entry = policy->freq_table;
> > > -	do {
> > > -		entry++;
> > > -		freq = entry->frequency;
> > > -	} while (freq >= target_freq && freq != CPUFREQ_TABLE_END);
> > > -	entry--;
> > > +	index = cpufreq_frequency_table_target(policy, target_freq,
> > > +					       CPUFREQ_RELATION_L);
> > 
> > Can we call cpufreq_find_index_l directly here? Seems like we could
> > phase out cpufreq_frequency_table_target() for the most part and call
> > the helpers directly. It would avoid some code bloat, an unnecessary
> > switch statement and an error check for an invalid frequency table which
> > seems unnecessary for every frequency table lookup.
> 
> I agree with that, though that requires larger changes across multiple
> sites.

What changes and where?

> I hope it will be fine if I do it in a separate patch on top of
> all this. Right ?

Depending.

  reply	other threads:[~2016-06-06 12:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 13:35 [PATCH V3 0/9] cpufreq: Sort policy->freq_table Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 1/9] cpufreq: Use policy->freq_table in ->target_index() Viresh Kumar
2016-06-03 13:35   ` Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 2/9] cpufreq: blackfin: Use 'index' only to index into policy->freq_table Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 3/9] cpufreq: elanfreq: " Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 4/9] cpufreq: exynos: " Viresh Kumar
2016-06-03 13:35   ` Viresh Kumar
2016-06-06  7:07   ` Krzysztof Kozlowski
2016-06-06  7:07     ` Krzysztof Kozlowski
2016-06-03 13:35 ` [PATCH V3 5/9] cpufreq: ia64: " Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 6/9] cpufreq: imx: " Viresh Kumar
2016-06-06  3:58   ` Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 7/9] cpufreq: maple: " Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order Viresh Kumar
2016-06-03 23:48   ` Steve Muckle
2016-06-06  3:52     ` Viresh Kumar
2016-06-06 12:10       ` Rafael J. Wysocki [this message]
2016-06-06 12:24         ` Viresh Kumar
2016-06-06 12:24           ` Viresh Kumar
2016-06-06 12:57           ` Rafael J. Wysocki
2016-06-06 16:25             ` Viresh Kumar
2016-06-06 21:56               ` Rafael J. Wysocki
2016-06-07  4:28                 ` Viresh Kumar
2016-06-08  0:38                   ` Rafael J. Wysocki
2016-06-08  3:48                     ` Viresh Kumar
2016-06-03 13:35 ` [PATCH V3 9/9] cpufreq: drivers: Free frequency tables after being used Viresh Kumar
2016-06-06 22:45   ` Rafael J. Wysocki
2016-06-06 21:09 ` [PATCH V3 0/9] cpufreq: Sort policy->freq_table Rafael J. Wysocki
2016-06-07  3:48   ` Viresh Kumar

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=1649758.V7uyzAJShK@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=benh@kernel.crashing.org \
    --cc=dbaryshkov@gmail.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=realmz6@gmail.com \
    --cc=shawn.guo@freescale.com \
    --cc=steve.muckle@linaro.org \
    --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.