From: "Doug Smythies" <dsmythies@telus.net>
To: "'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
'Linux PM list' <linux-pm@vger.kernel.org>
Cc: 'Linux Kernel Mailing List' <linux-kernel@vger.kernel.org>,
'Srinivas Pandruvada' <srinivas.pandruvada@linux.intel.com>,
'Peter Zijlstra' <peterz@infradead.org>,
'Viresh Kumar' <viresh.kumar@linaro.org>,
'Ingo Molnar' <mingo@redhat.com>,
'Vincent Guittot' <vincent.guittot@linaro.org>,
'Morten Rasmussen' <morten.rasmussen@arm.com>,
'Juri Lelli' <Juri.Lelli@arm.com>,
'Dietmar Eggemann' <dietmar.eggemann@arm.com>,
'Steve Muckle' <smuckle@linaro.org>
Subject: RE: [RFC/RFT][PATCH 2/4] cpufreq: intel_pstate: Change P-state selection algorithm for Core
Date: Wed, 7 Sep 2016 08:26:05 -0700 [thread overview]
Message-ID: <005401d2091c$2885fe50$7991faf0$@net> (raw)
In-Reply-To: fzJYbhOgVcv8ifzJabBXDd
On 2016.09.02 18:02 Rafael J. Wysocki wrote:
...[cut]...
> This includes an IIR filter on top of the load-based P-state selection,
> but the filter is applied to the non-boosted case only (otherwise it
> defeats the point of the boost) and I used a slightly different raw gain
> value.
The different gain value, 12.5% instead 10%, does come at a cost of some
energy. Although we are finding inconsistencies in the test results.
(I estimated about 2.2% energy cost, for my 20% SpecPower simulator test,
and scaling off of a simple graph I did of energy vs gain with the previous
version).
...[cut]...
> + intel_pstate_get_min_max(cpu, &min_perf, &max_perf);
> + target = clamp_val(target, int_tofp(min_perf), int_tofp(max_perf));
> + sample->target = fp_toint(target + (1 << (FRAC_BITS-1)));
> + return sample->target;
> +}
> +
In my earlier proposed versions, it was very much on purpose that it
was keeping the pseudo floating point filtered target. Excerpt:
+ cpu->sample.target = div_u64((int_tofp(100) - scaled_gain) *
+ cpu->sample.target + scaled_gain *
+ unfiltered_target, int_tofp(100));
+ /*
+ * Clamp the filtered value.
+ */
+ intel_pstate_get_min_max(cpu, &min_perf, &max_perf);
+ if (cpu->sample.target < int_tofp(min_perf))
+ cpu->sample.target = int_tofp(min_perf);
+ if (cpu->sample.target > int_tofp(max_perf))
+ cpu->sample.target = int_tofp(max_perf);
+
+ return fp_toint(cpu->sample.target + (1 << (FRAC_BITS-1)));
Why? To prevent a lock up scenario where, depending on the processor
and the gain settings, the target pstate would never kick over to the
next value. i.e. if it only increased 1/3 of a pstate per iteration
as the filter approached its steady state value. While this condition
did occur in my older proposed implementations, with my processor it
doesn't seem to with this implementation. I didn't theoretically check
other processors.
Another side effect of this change is effectively a further increase
in the gain setting, and thus more energy being given back. This was
determined by looking at step function load response times, as opposed
to math analysis. (I can make pretty graphs if you want.)
The purpose of this e-mail just to make us aware of the tradeoffs,
not to imply it should change.
... Doug
next prev parent reply other threads:[~2016-09-07 15:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-03 0:56 [RFC/RFT][PATCH 0/4] cpufreq / sched: iowait boost in intel_pstate and schedutil Rafael J. Wysocki
2016-09-03 0:58 ` [RFC/RFT][PATCH 1/4] cpufreq / sched: SCHED_CPUFREQ_IOWAIT flag to indicate iowait condition Rafael J. Wysocki
2016-09-03 1:02 ` [RFC/RFT][PATCH 2/4] cpufreq: intel_pstate: Change P-state selection algorithm for Core Rafael J. Wysocki
2016-09-03 1:03 ` [RFC/RFT][PATCH 3/4] cpufreq: intel_pstate: Use average P-state in get_target_pstate_default() Rafael J. Wysocki
2016-09-03 1:04 ` [RFC/RFT][PATCH 4/4] cpufreq: schedutil: Add iowait boosting Rafael J. Wysocki
2016-09-07 15:26 ` Doug Smythies [this message]
2016-09-08 0:22 ` [RFC/RFT][PATCH 0/4] cpufreq / sched: iowait boost in intel_pstate and schedutil Steve Muckle
2016-09-08 0:35 ` Srinivas Pandruvada
2016-09-08 0:44 ` Rafael J. Wysocki
2016-09-08 0:49 ` Srinivas Pandruvada
2016-09-08 1:15 ` Rafael J. Wysocki
2016-09-08 15:02 ` Rafael J. Wysocki
2016-09-08 17:30 ` Srinivas Pandruvada
2016-09-08 19:26 ` Steve Muckle
2016-09-08 19:49 ` Srinivas Pandruvada
2016-09-08 0:37 ` 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='005401d2091c$2885fe50$7991faf0$@net' \
--to=dsmythies@telus.net \
--cc=Juri.Lelli@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=smuckle@linaro.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=vincent.guittot@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;
as well as URLs for NNTP newsgroup(s).