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


Groups > linux.kernel > #1442818 > unrolled thread

[PATCH v3 0/3] cpufreq: avoid redundant driver calls in schedutil

Started bySteve Muckle <steve.muckle@linaro.org>
First post2016-07-13 22:30 +0200
Last post2016-07-21 22:10 +0200
Articles 4 on this page of 24 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/3] cpufreq: avoid redundant driver calls in schedutil Steve Muckle <steve.muckle@linaro.org> - 2016-07-13 22:30 +0200
    [PATCH v3 3/3] cpufreq: acpi-cpufreq: use cached frequency mapping when possible Steve Muckle <steve.muckle@linaro.org> - 2016-07-13 22:30 +0200
    [PATCH v3 2/3] cpufreq: schedutil: map raw required frequency to driver frequency Steve Muckle <steve.muckle@linaro.org> - 2016-07-13 22:30 +0200
    [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-13 22:30 +0200
      Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 22:00 +0200
        Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-07-21 22:30 +0200
          Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 22:40 +0200
            Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-07-21 22:50 +0200
              Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 23:00 +0200
                Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 23:20 +0200
                Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-07-21 23:20 +0200
            Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 01:30 +0200
              Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-22 01:40 +0200
                Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 01:40 +0200
                  Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 01:50 +0200
                  Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 02:50 +0200
                    Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-22 17:20 +0200
                      Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 19:50 +0200
              Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-22 01:40 +0200
              Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Steve Muckle <steve.muckle@linaro.org> - 2016-07-22 01:40 +0200
      Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq() Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 23:20 +0200
    Re: [PATCH v3 0/3] cpufreq: avoid redundant driver calls in schedutil Pingbo Wen <pingbo.wen@linaro.org> - 2016-07-14 12:10 +0200
      Re: [PATCH v3 0/3] cpufreq: avoid redundant driver calls in schedutil Steve Muckle <steve.muckle@linaro.org> - 2016-07-14 20:10 +0200
    Re: [PATCH v3 0/3] cpufreq: avoid redundant driver calls in schedutil Viresh Kumar <viresh.kumar@linaro.org> - 2016-07-21 22:10 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1448151 — Re: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq()

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-07-21 23:20 +0200
SubjectRe: [PATCH v3 1/3] cpufreq: add cpufreq_driver_resolve_freq()
Message-ID<rXtxT-4A4-11@gated-at.bofh.it>
In reply to#1442822
On 13-07-16, 13:25, Steve Muckle wrote:
> +unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
> +					 unsigned int target_freq)
> +{
> +	target_freq = clamp_val(target_freq, policy->min, policy->max);
> +	policy->cached_target_freq = target_freq;
> +	if (cpufreq_driver->resolve_freq)
> +		return cpufreq_driver->resolve_freq(policy, target_freq);
> +	policy->cached_resolved_idx =
> +		cpufreq_frequency_table_target(policy, target_freq,
> +					       CPUFREQ_RELATION_L);
> +	return policy->freq_table[policy->cached_resolved_idx].frequency;

FWIW, this may crash the kernel for a driver that provides ->target()
but no ->resolve_freq().

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1443334

FromPingbo Wen <pingbo.wen@linaro.org>
Date2016-07-14 12:10 +0200
Message-ID<rULKH-8kS-63@gated-at.bofh.it>
In reply to#1442818

On Thursday, July 14, 2016 04:25 AM, Steve Muckle wrote:
> Invoking the cpufreq driver to set a frequency can be expensive. On platforms
> with a cpufreq driver that does not support fast switching a thread must be
> woken to complete the operation. IPIs will also occur if and when support to
> process remote task wakeups is added in schedutil.
> 
> Currently schedutil calculates a raw frequency request from scheduler
> utilization data. This raw frequency request does not correlate to supported
> cpufreq driver frequencies aside from being capped by the CPU's maximum
> frequency. Consequently, there may be many consecutive requests for different
> raw frequency values which all translate to the same driver-supported
> frequency. For example on a platform with 3 supported frequencies 200MHz,
> 400MHz, and 600MHz, raw requests for 257MHz, 389MHz, and 307MHz all map to a
> driver-supported frequency of 400MHz in schedutil. Assuming these requests were
> consecutive and there were no changes in policy limits (min/max), there is no
> need to issue the second or third request.
> 
> In order to resolve a raw frequency request to a driver-supported one a new
> cpufreq API is added, cpufreq_driver_resolve_freq(). This API relies on a new
> cpufreq driver callback in the case of ->target() style drivers. Otherwise it
> uses the existing frequency table operations.
> 
> Lookups are cached both in cpufreq_driver_resolve_freq() (for the benefit of the
> driver) and in schedutil.
> 
> Changes since v2:
> - incorporated feedback from Viresh to use resolve_freq driver callbacks
>   only for ->target() style drivers, to use cpufreq's freq table operations,
>   and move freq mapping caching into cpufreq policy
> Changes since v1:
> - incorporated feedback from Rafael to avoid referencing freq_table from
>   schedutil by introducing a new cpufreq API
> 
> Steve Muckle (3):
>   cpufreq: add cpufreq_driver_resolve_freq()
>   cpufreq: schedutil: map raw required frequency to driver frequency

Tested the first two patches on db410c, only waking up irq_work 53
times, while previous was 257 times(79% decrease) in Android home idle
for 5 minutes.

>   cpufreq: acpi-cpufreq: use cached frequency mapping when possible
> 

Pingbo

[toc] | [prev] | [next] | [standalone]


#1443658

FromSteve Muckle <steve.muckle@linaro.org>
Date2016-07-14 20:10 +0200
Message-ID<rUTfc-4BY-27@gated-at.bofh.it>
In reply to#1443334
On Thu, Jul 14, 2016 at 06:02:31PM +0800, Pingbo Wen wrote:
> > Steve Muckle (3):
> >   cpufreq: add cpufreq_driver_resolve_freq()
> >   cpufreq: schedutil: map raw required frequency to driver frequency
> 
> Tested the first two patches on db410c, only waking up irq_work 53
> times, while previous was 257 times(79% decrease) in Android home idle
> for 5 minutes.

Thanks Pingbo. My experience measuring the number of calls into the acpi
cpufreq fast switch path was similar. An arbitrary system workload I
chose showed a ~75% reduction in calls.

thanks,
Steve

[toc] | [prev] | [next] | [standalone]


#1448112

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-07-21 22:10 +0200
Message-ID<rXss9-3T5-11@gated-at.bofh.it>
In reply to#1442818
On 13-07-16, 13:25, Steve Muckle wrote:
> Invoking the cpufreq driver to set a frequency can be expensive. On platforms
> with a cpufreq driver that does not support fast switching a thread must be
> woken to complete the operation. IPIs will also occur if and when support to
> process remote task wakeups is added in schedutil.
> 
> Currently schedutil calculates a raw frequency request from scheduler
> utilization data. This raw frequency request does not correlate to supported
> cpufreq driver frequencies aside from being capped by the CPU's maximum
> frequency. Consequently, there may be many consecutive requests for different
> raw frequency values which all translate to the same driver-supported
> frequency. For example on a platform with 3 supported frequencies 200MHz,
> 400MHz, and 600MHz, raw requests for 257MHz, 389MHz, and 307MHz all map to a
> driver-supported frequency of 400MHz in schedutil. Assuming these requests were
> consecutive and there were no changes in policy limits (min/max), there is no
> need to issue the second or third request.
> 
> In order to resolve a raw frequency request to a driver-supported one a new
> cpufreq API is added, cpufreq_driver_resolve_freq(). This API relies on a new
> cpufreq driver callback in the case of ->target() style drivers. Otherwise it
> uses the existing frequency table operations.
> 
> Lookups are cached both in cpufreq_driver_resolve_freq() (for the benefit of the
> driver) and in schedutil.
> 
> Changes since v2:
> - incorporated feedback from Viresh to use resolve_freq driver callbacks
>   only for ->target() style drivers, to use cpufreq's freq table operations,
>   and move freq mapping caching into cpufreq policy

Sorry for the delay buddy :(

I have some concerns for the first patch. The second and third patch
look fine.  Feel free to add my 

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>

for them.

-- 
viresh

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web