Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411504

Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target()

From Steve Muckle <steve.muckle@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target()
Date 2016-06-01 21:50 +0200
Message-ID <rFkjn-4fq-7@gated-at.bofh.it> (permalink)
References <rFbSN-7iv-13@gated-at.bofh.it> <rFbSN-7iv-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 01, 2016 at 04:09:55PM +0530, Viresh Kumar wrote:
> cpufreq core keeps another table of sorted frequencies now and that can
> be used to find a match quickly, instead of traversing the unsorted list
> in an inefficient way.
> 
> Create helper routines for separate relation types to optimize it
> further.
> 
> Ideally the new routine cpufreq_find_target_index() is required to be
> exported, but s3c24xx was abusing the earlier API and have to be
> supported for now. Added a FIXME for it.
> 
> Tested on Exynos board with both ondemand and schedutil governor and
> confirmed with help of various print messages that we are eventually
> switching to the desired frequency based on a target frequency.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/acpi-cpufreq.c    |  15 ++--
>  drivers/cpufreq/freq_table.c      | 180 ++++++++++++++++++++++----------------
>  drivers/cpufreq/s3c24xx-cpufreq.c |  13 ++-
>  include/linux/cpufreq.h           |  20 ++++-
>  4 files changed, 134 insertions(+), 94 deletions(-)
> 
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 32a15052f363..4f9f7504a17c 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -468,20 +468,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);

This adds a function call to the fast path...

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-01 12:50 +0200
  Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Steve Muckle <steve.muckle@linaro.org> - 2016-06-01 21:50 +0200
    Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-02 03:30 +0200
      Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Steve Muckle <steve.muckle@linaro.org> - 2016-06-02 20:30 +0200
        Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-03 05:20 +0200

csiph-web