[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150910012222.GN5266@linux>
Date: Thu, 10 Sep 2015 06:52:22 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
Kristen Carlson Accardi <kristen@...ux.intel.com>,
open list <linux-kernel@...r.kernel.org>,
Sudeep Holla <sudeep.holla@....com>
Subject: Re: [PATCH] cpufreq: pass policy to ->get() driver callback
On 10-09-15, 03:41, Rafael J. Wysocki wrote:
> I see one. That unfortunately is the acpi-cpufreq driver, but it still is one.
Hmm..
> Well, cpufreq_generic_get() does _get_raw(), so I suppose acpi-cpufreq may
> do that too?
Yeah, it can.
> > 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.
Hmm.. Actually almost every other callback (bios_limit() is another
one), passes the policy to the driver, and I thought always passing
the policy will make it more symmetrical. And the expectation that the
cpufreq drivers wouldn't need to use policy from the ->get() callback
would be wrong. Even if there are only few users today. One is the
acpi-cpufreq driver and others are the ones, that are using
cpufreq_generic_get() :)
> 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.
I agree.
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists