From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: Juri Lelli <juri.lelli@arm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Steve Muckle <steve.muckle@linaro.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC/RFT][PATCH v4 1/2] cpufreq: New governor using utilization data from the scheduler
Date: Sat, 27 Feb 2016 01:21:36 +0100 [thread overview]
Message-ID: <3409567.SO0ZcZmU7l@vostro.rjw.lan> (raw)
In-Reply-To: <1825489.pc33SqXSIB@vostro.rjw.lan>
On Thursday, February 25, 2016 10:14:35 PM Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Add a new cpufreq scaling governor, called "schedutil", that uses
> scheduler-provided CPU utilization information as input for making
> its decisions.
>
> Doing that is possible after commit fe7034338ba0 (cpufreq: Add
> mechanism for registering utilization update callbacks) that
> introduced cpufreq_update_util() called by the scheduler on
> utilization changes (from CFS) and RT/DL task status updates.
> In particular, CPU frequency scaling decisions may be based on
> the the utilization data passed to cpufreq_update_util() by CFS.
>
> The new governor is very simple. It is almost as simple as it
> can be and remain reasonably functional.
>
> The frequency selection formula used by it is essentially the same
> as the one used by the "ondemand" governor, although it doesn't use
> the additional up_threshold parameter, but instead of computing the
> load as the "non-idle CPU time" to "total CPU time" ratio, it takes
> the utilization data provided by CFS as input. More specifically,
> it represents "load" as the util/max ratio, where util and max
> are the utilization and CPU capacity coming from CFS.
>
> All of the computations are carried out in the utilization update
> handlers provided by the new governor. One of those handlers is
> used for cpufreq policies shared between multiple CPUs and the other
> one is for policies with one CPU only (and therefore it doesn't need
> to use any extra synchronization means). The only operation carried
> out by the new governor's ->gov_dbs_timer callback, sugov_set_freq(),
> is a __cpufreq_driver_target() call to trigger a frequency update (to
> a value already computed beforehand in one of the utilization update
> handlers). This means that, at least for some cpufreq drivers that
> can update CPU frequency by doing simple register writes, it should
> be possible to set the frequency in the utilization update handlers
> too in which case all of the governor's activity would take place in
> the scheduler paths invoking cpufreq_update_util() without the need
> to run anything in process context.
>
> Currently, the governor treats all of the RT and DL tasks as
> "unknown utilization" and sets the frequency to the allowed
> maximum when updated from the RT or DL sched classes. That
> heavy-handed approach should be replaced with something more
> specifically targeted at RT and DL tasks.
>
> To some extent it relies on the common governor code in
> cpufreq_governor.c and it uses that code in a somewhat unusual
> way (different from what the "ondemand" and "conservative"
> governors do), so some small and rather unintrusive changes
> have to be made in that code and the other governors to support it.
>
> However, after making it possible to set the CPU frequency from
> the utilization update handlers, that new governor's interactions
> with the common code might be limited to the initialization, cleanup
> and handling of sysfs attributes (currently only one attribute,
> sampling_rate, is supported in addition to the standard policy
> attributes handled by the cpufreq core).
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> There was no v3 of this patch, but patch [2/2] had a v3 in the meantime.
>
> Changes from v2:
> - Avoid requesting the same frequency that was requested last time for
> the given policy.
>
> Changes from v1:
> - Use policy->min and policy->max as min/max frequency in computations.
>
Well, this is getting interesting. :-)
Some preliminary results from SpecPower indicate that this governor (with
patch [2/2] on top), as simple as it is, beats "ondemand" in performance/power
and generally allows the system to achieve better performance. The difference
is not significant, but measurable.
If that is confirmed in further testing, I will be inclined to drop this thing
in in the next cycle.
Thanks,
Rafael
next prev parent reply other threads:[~2016-02-27 0:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 23:16 [RFC/RFT][PATCH 0/1] cpufreq: New governor based on scheduler-provided utilization data Rafael J. Wysocki
2016-02-21 23:18 ` [RFC/RFT][PATCH 1/1] cpufreq: New governor using utilization data from the scheduler Rafael J. Wysocki
2016-02-22 14:16 ` Juri Lelli
2016-02-22 23:02 ` Rafael J. Wysocki
2016-02-23 7:20 ` Steve Muckle
2016-02-24 1:38 ` Rafael J. Wysocki
2016-02-25 11:01 ` Juri Lelli
2016-02-26 2:36 ` Rafael J. Wysocki
2016-03-01 14:56 ` Juri Lelli
2016-03-01 20:26 ` Rafael J. Wysocki
2016-02-24 1:20 ` [RFC/RFT][PATCH v2 0/2] cpufreq: New governor based on scheduler-provided utilization data Rafael J. Wysocki
2016-02-24 1:22 ` [RFC/RFT][PATCH v2 1/2] cpufreq: New governor using utilization data from the scheduler Rafael J. Wysocki
2016-02-25 21:14 ` [RFC/RFT][PATCH v4 " Rafael J. Wysocki
2016-02-27 0:21 ` Rafael J. Wysocki [this message]
2016-02-27 4:33 ` Steve Muckle
2016-02-27 15:24 ` Rafael J. Wysocki
2016-03-01 4:10 ` Steve Muckle
2016-03-01 20:20 ` Rafael J. Wysocki
2016-03-03 3:20 ` Steve Muckle
2016-03-03 3:35 ` Steve Muckle
2016-03-03 19:20 ` Rafael J. Wysocki
2016-02-24 1:28 ` [RFC/RFT][PATCH v2 2/2] cpufreq: schedutil: Switching frequencies from interrupt context Rafael J. Wysocki
2016-02-24 23:30 ` [RFC/RFT][PATCH v3 " Rafael J. Wysocki
2016-02-25 9:08 ` Peter Zijlstra
2016-02-25 9:12 ` Peter Zijlstra
2016-02-25 11:11 ` Rafael J. Wysocki
2016-02-25 11:10 ` Rafael J. Wysocki
2016-02-25 11:52 ` Peter Zijlstra
2016-02-25 20:54 ` Rafael J. Wysocki
2016-02-25 21:20 ` [RFC/RFT][PATCH v4 " Rafael J. Wysocki
2016-03-03 14:27 ` [RFC/RFT][PATCH 0/1] cpufreq: New governor based on scheduler-provided utilization data Ingo Molnar
2016-03-03 17:15 ` 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=3409567.SO0ZcZmU7l@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=srinivas.pandruvada@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®