From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
smuckle@linaro.org, Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 0/2] cpufreq: Use sorted frequency tables
Date: Tue, 31 May 2016 17:06:01 +0530 [thread overview]
Message-ID: <cover.1464694144.git.viresh.kumar@linaro.org> (raw)
Hi Guys,
This work in inspired by some of the concerns raised by Steve in one of
his patchset.
Currently, the cpufreq drivers aren't required to provide a sorted list
of frequencies to the cpufreq-core and so traversing that list match a
target frequency is very inefficient.
This is not bearable by, for example, the fast-switch path of schedutil
governor and so we have moved the traversing logic local to the
acpi-cpufreq driver for now. That is better handled in the core, but it
has to be efficient.
OTOH, even for traditional governors without a fast-switch path, it
would be much better to be able to traverse this table quickly.
The ideal solution would be to keep a single freq-table in struct
cpufreq_policy, that will be sorted as well. But there are few
dependencies due to which it can't be done today (Hint: cpufreq drivers
are abusing the 'index' passed to them, to refer to multiple arrays).
And so for now, lets create a separate table local to the cpufreq-core
only.
To use that, another API cpufreq_find_target_index() is created as well
and few users are migrated to it.
Lightly tested on Exynos board, frequencies were getting selected as
expected.
--
viresh
Viresh Kumar (2):
cpufreq: Store sorted frequency table
cpufreq: Implement cpufreq_find_target_index() to traverse sorted list
drivers/cpufreq/acpi-cpufreq.c | 18 ++--
drivers/cpufreq/cpufreq.c | 48 ++++++-----
drivers/cpufreq/freq_table.c | 191 +++++++++++++++++++++++++++++++++++++++++
include/linux/cpufreq.h | 7 ++
4 files changed, 231 insertions(+), 33 deletions(-)
--
2.7.1.410.g6faf27b
next reply other threads:[~2016-05-31 11:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 11:36 Viresh Kumar [this message]
2016-05-31 11:36 ` [PATCH 1/2] cpufreq: Store sorted frequency table Viresh Kumar
2016-05-31 11:36 ` [PATCH 2/2] cpufreq: Implement cpufreq_find_target_index() to traverse sorted list Viresh Kumar
2016-05-31 22:50 ` [PATCH 0/2] cpufreq: Use sorted frequency tables Rafael J. Wysocki
2016-06-01 1:08 ` Steve Muckle
2016-06-01 10:46 ` Viresh Kumar
2016-06-01 19:23 ` Steve Muckle
2016-06-01 16:40 ` Rafael J. Wysocki
2016-06-01 19:37 ` Steve Muckle
2016-06-01 20:17 ` Rafael J. Wysocki
2016-06-01 10:42 ` Viresh Kumar
2016-06-01 16:37 ` Rafael J. Wysocki
2016-06-02 1:25 ` 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=cover.1464694144.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=smuckle@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).