public inbox for cpufreq@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org,
	robin.randhawa@arm.com, Steve.Bannister@arm.com,
	Liviu.Dudau@arm.com,
	Charles Garcia-Tobin <Charles.Garcia-Tobin@arm.com>
Subject: Re: [PATCH 0/4] CPUFreq: Implement per policy instances of governors
Date: Tue, 5 Feb 2013 11:27:21 +0100	[thread overview]
Message-ID: <20130205102721.GB4827@pd.tnic> (raw)
In-Reply-To: <CAKohpo=6q+Bcgq0Re=3SXM6zwub5N=vJBO=sTeEgZZ9byFK7=g@mail.gmail.com>

On Tue, Feb 05, 2013 at 03:17:21PM +0530, Viresh Kumar wrote:
> > multiple policies support in cpufreq should be optional and
> > selectable in Kconfig so that systems which don't need that, don't
> > have to see or use it. It is yet another feature which doesn't apply
> > universally so we make such features optional. Like the rest of the
> > gazillion things in the kernel already.
> 
> I understand what Kconfig options are for, but i am not able to understand
> what's the benefit of this option here.

Are you kidding me? You're simply not reading what I'm saying to you:
"... should be optional and selectable in Kconfig so that systems which
don't need that, don't have to see or use it." Because on those systems
it doesn't apply.

How about we add an x86-specific extension which is a big wad of code
and is needlessly run on ARM just because it is easier?

That's why we do config options, so that code which doesn't apply on a
specific system, doesn't run on it.

Goddammit, how hard is to understand that??!

> For example: for single image solutions we need to keep it enabled.

So keep it enabled!

> And so, would need some sort of logic in cpufreq core & platform
> driver to decide where to create the governors directory.
>
> The code without Kconfig option would be as simple as:

> 
> platform_driver:
> init(struct cpufreq_policy *policy)
> {
> ..
>     policy->have_multiple_policies = true;
> ..
> }
> 
> cpufreq-core:
> 
> add_dev()
> {
>     if (policy->have_multiple_policies)
>         create-folder-in-cpu/cpu*/cpufreq;
>     else
>         create-folder-in-cpu/cpufreq;

Yes, this is how it could be done.

And this is what I mean by making it optional:

You go and abstract away the "create-folder-in-cpu/cpu*/cpufreq"
functionality. If this is a function called
add_additional_sysfs_entries(), for example, it should do nothing when
CONFIG_CPUFREQ_MULTIPLE_POLICIES is disabled. Otherwise, it will do your
dance:

#ifdef CONFIG_CPUFREQ_MULTIPLE_POLICIES
static int add_additional_sysfs_entries(...)
{

	do all stuff required for multiple policies

}
#else /* CONFIG_CPUFREQ_MULTIPLE_POLICIES */
static int add_additional_sysfs_entries(...)
{
	return 0;
}
#endif /* CONFIG_CPUFREQ_MULTIPLE_POLICIES */

and all the rest of the stuff which is needed for multiple system
policies, should be abstracted that way, more functions added, whatever.
If it is starting to become more, you can create your own compilation
unit. And so on and so on... the kernel is full of examples how to do
stuff like that.

> And so, platforms like Krait or big.LITTLE can set it to true from their
> cpufreq-drivers. And this wouldn't break any of the current platforms.
> 
> > The existing sysfs layout cannot be changed because you're breaking
> > userspace and we don't do that. It is that simple.
> 
> That's fine. I understood it already. :)

Not really, you obviously didn't.

> The problem i see is:
> - both governor tunables, cpufreq-stats & policy tunables (P-states) have the
> same requirement. They are all per policy or clock-domain, instead of per cpu.
> - I want to keep all of these at the same place, as they should be
> present in the
> same hierarchy.
> - If we move everything to cpu/cpufreq/policy-names/ then also we would break
> existing userspace stuff for stats and P-states.
> - If we move everything to cpu/cpu*/cpufreq/ then also we would break
> existing userspace stuff for governors.

No, you're not allowed to change existing sysfs layout. FULLSTOP.

Simply add the new stuff to cpu/cpu*/cpufreq/ with code which
is enabled when CONFIG_CPUFREQ_MULTIPLE_POLICIES is set. If
CONFIG_CPUFREQ_MULTIPLE_POLICIES is not enabled, nothing changes.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  reply	other threads:[~2013-02-05 10:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 11:38 [PATCH 0/4] CPUFreq: Implement per policy instances of governors Viresh Kumar
     [not found] ` <cover.1359976493.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-02-04 11:38   ` [PATCH 1/4] cpufreq: Don't check cpu_online(policy->cpu) Viresh Kumar
2013-02-04 11:38   ` [PATCH 2/4] cpufreq: stats: Get rid of CPUFREQ_STATDEVICE_ATTR Viresh Kumar
2013-02-04 11:38   ` [PATCH 3/4] cpufreq: Add per policy governor-init/exit infrastructure Viresh Kumar
2013-02-04 11:38   ` [PATCH 4/4] cpufreq: governor: Implement per policy instances of governors Viresh Kumar
2013-02-10 21:14     ` Francesco Lavra
2013-02-11  4:16       ` Viresh Kumar
2013-02-11  4:39         ` Viresh Kumar
2013-02-04 12:17   ` [PATCH 0/4] CPUFreq: " Rafael J. Wysocki
2013-02-04 12:24     ` Viresh Kumar
2013-02-04 12:32       ` Borislav Petkov
2013-02-04 12:54         ` Viresh Kumar
2013-02-04 13:04           ` Borislav Petkov
2013-02-04 13:25             ` Viresh Kumar
2013-02-04 13:36               ` Borislav Petkov
2013-02-04 13:58                 ` Viresh Kumar
2013-02-04 14:09                   ` Borislav Petkov
2013-02-04 14:21                     ` Viresh Kumar
2013-02-04 15:05                       ` Borislav Petkov
2013-02-04 15:37                         ` Viresh Kumar
2013-02-04 16:50                           ` Borislav Petkov
2013-02-05  7:20                             ` Viresh Kumar
2013-02-05  9:15                               ` Borislav Petkov
     [not found]                                 ` <20130205091532.GA4827-fF5Pk5pvG8Y@public.gmane.org>
2013-02-05  9:47                                   ` Viresh Kumar
2013-02-05 10:27                                     ` Borislav Petkov [this message]
2013-02-05 10:43                                       ` Viresh Kumar
2013-02-05 11:04                                         ` Borislav Petkov
2013-02-05 11:12                                           ` Viresh Kumar
2013-02-05 11:19                                             ` Borislav Petkov
2013-02-05 11:26                                               ` Viresh Kumar
2013-02-05 11:32                                                 ` Borislav Petkov
2013-02-05 12:24                                                   ` Viresh Kumar
2013-02-05 13:22                                                     ` Borislav Petkov
2013-02-05 13:55                                                       ` Viresh Kumar
2013-02-05  9:36                 ` Viresh Kumar
     [not found]                   ` <CAKohpokejWugM+wP5xcqp0F9AggLxuEf9Ox5fDViMxJh1c+kEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-05 11:29                     ` Charles Garcia-Tobin
2013-02-05 11:39                       ` Borislav Petkov
2013-02-05 18:38                         ` Charles Garcia-Tobin
2013-02-05 18:44                           ` Borislav Petkov
2013-02-05 16:21 ` Viresh Kumar
2013-02-06  9:58   ` Viresh Kumar
2013-02-06 10:08     ` Amit Kucheria
2013-02-06 10:15       ` Viresh Kumar
2013-02-06 10:38         ` 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=20130205102721.GB4827@pd.tnic \
    --to=bp@alien8.de \
    --cc=Charles.Garcia-Tobin@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Steve.Bannister@arm.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=robin.randhawa@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