From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
Kristen Carlson Accardi <kristen@linux.intel.com>,
open list <linux-kernel@vger.kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [PATCH] cpufreq: pass policy to ->get() driver callback
Date: Thu, 10 Sep 2015 03:41:45 +0200 [thread overview]
Message-ID: <11470100.cEo24Tpcgr@vostro.rjw.lan> (raw)
In-Reply-To: <98e79b26d8250c33001c7a50378b0e288b8511db.1438339396.git.viresh.kumar@linaro.org>
On Friday, July 31, 2015 04:14:33 PM Viresh Kumar wrote:
> CPUFreq drivers today support ->get(cpu) callback, which returns current
> clock rate of the CPU. The problem with ->get() is that it takes cpu
> number as parameter and this unnecessarily makes things complex.
>
> Firstly the core gets the cpu number by doing operation 'policy->cpu' on
> the policy and then many drivers
I see one. That unfortunately is the acpi-cpufreq driver, but it still is one.
Well, cpufreq_generic_get() does _get_raw(), so I suppose acpi-cpufreq may
do that too?
> need to get the policy back and so do
> cpufreq_cpu_get(cpu) on the cpu passed as argument to ->get().
>
> It would be better if we pass them 'policy' directly and drivers can use
> policy->cpu if that's all they need.
Passing a pointer and dereferencing it is generally less efficient than passing
a number. Before the patch the core has to do the dereference before calling
->get, so it likely doesn't matter here, but the code churn from this change
is quite substantial and the benefit from it is in the noise IMO.
Overall, we need to talk about the design aspect of cpufreq, because there
are much more significant issues in it than things like this one.
Thanks,
Rafael
next prev parent reply other threads:[~2015-09-10 1:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 10:44 Viresh Kumar
2015-09-03 4:45 ` Viresh Kumar
2015-09-04 14:50 ` Rafael J. Wysocki
2015-09-10 1:41 ` Rafael J. Wysocki [this message]
2015-09-10 1:22 ` Viresh Kumar
2015-09-10 21:36 ` Rafael J. Wysocki
2015-09-11 16:18 ` Viresh Kumar
2015-09-15 7:39 ` Viresh Kumar
2015-09-15 7:58 ` Viresh Kumar
2015-09-16 1:30 ` Rafael J. Wysocki
2015-09-10 21:40 ` Rafael J. Wysocki
2015-09-10 21:59 ` Rafael J. Wysocki
2015-09-15 7:54 ` Viresh Kumar
2015-09-16 1:42 ` 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=11470100.cEo24Tpcgr@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=kristen@linux.intel.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sudeep.holla@arm.com \
--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®