linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@sisk.pl
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
	robin.randhawa@arm.com, Steve.Bannister@arm.com,
	Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH V3 2/4] cpufreq: governor: Implement per policy instances of governors
Date: Wed, 20 Mar 2013 10:59:13 +0530	[thread overview]
Message-ID: <CAKohponTZ29BX6CrUvFMy9RXV==0wRFu4C-W1xd6t1RmLASTvQ@mail.gmail.com> (raw)
In-Reply-To: <0823a96fea2d8284b7d83cee390dd5973fdaaa94.1362381470.git.viresh.kumar@linaro.org>

On 4 March 2013 13:07, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Currently, there can't be multiple instances of single governor_type. If we have
> a multi-package system, where we have multiple instances of struct policy (per
> package), we can't have multiple instances of same governor. i.e. We can't have
> multiple instances of ondemand governor for multiple packages.
>
> Governors directory in sysfs is created at /sys/devices/system/cpu/cpufreq/
> governor-name/. Which again reflects that there can be only one instance of a
> governor_type in the system.
>
> This is a bottleneck for multicluster system, where we want different packages
> to use same governor type, but with different tunables.
>
> This patch uses the infrastructure provided by earlier patch and implements
> init/exit routines for ondemand and conservative governors.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

As discussed in other patch thread, i dropped "cpufreq: Add Kconfig option
to enable/disable have_multiple_policies" patch and following is the fixup
to this patch:

I have queued all patches i had for 3.10 here:

http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-3.10

commit f02fca9a2478088c4f7dadf82d998ae007a56285
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Wed Mar 20 10:50:33 2013 +0530

    fixup! cpufreq: governor: Implement per policy instances of governors
---
 drivers/cpufreq/cpufreq.c |  8 ++++++++
 include/linux/cpufreq.h   | 22 ++++++++--------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index a843855..3d83b02 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -128,6 +128,14 @@ void disable_cpufreq(void)
 static LIST_HEAD(cpufreq_governor_list);
 static DEFINE_MUTEX(cpufreq_governor_mutex);

+struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy)
+{
+       if (cpufreq_driver->have_multiple_policies)
+               return &policy->kobj;
+       else
+               return cpufreq_global_kobject;
+}
+
 static struct cpufreq_policy *__cpufreq_cpu_get(unsigned int cpu, bool sysfs)
 {
        struct cpufreq_policy *data;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 6e1abd2..805c4d3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -107,11 +107,6 @@ struct cpufreq_policy {
        unsigned int            policy; /* see above */
        struct cpufreq_governor *governor; /* see below */
        void                    *governor_data;
-       /* This should be set by init() of platforms having multiple
-        * clock-domains, i.e.  supporting multiple policies. With this sysfs
-        * directories of governor would be created in cpu/cpu<num>/cpufreq/
-        * directory */
-       bool                    have_multiple_policies;

        struct work_struct      update; /* if update_policy() needs to be
                                         * called, but you're in IRQ context */
@@ -139,15 +134,6 @@ static inline bool policy_is_shared(struct
cpufreq_policy *policy)
        return cpumask_weight(policy->cpus) > 1;
 }

-static inline struct kobject *
-get_governor_parent_kobj(struct cpufreq_policy *policy)
-{
-       if (policy->have_multiple_policies)
-               return &policy->kobj;
-       else
-               return cpufreq_global_kobject;
-}
-
 /******************** cpufreq transition notifiers *******************/

 #define CPUFREQ_PRECHANGE      (0)
@@ -245,6 +231,13 @@ struct cpufreq_driver {
        struct module           *owner;
        char                    name[CPUFREQ_NAME_LEN];
        u8                      flags;
+       /*
+        * This should be set by init() of platforms having multiple
+        * clock-domains, i.e.  supporting multiple policies. With this sysfs
+        * directories of governor would be created in cpu/cpu<num>/cpufreq/
+        * directory
+        */
+       bool                    have_multiple_policies;

        /* needed by all drivers */
        int     (*init)         (struct cpufreq_policy *policy);
@@ -329,6 +322,7 @@ const char *cpufreq_get_current_driver(void);
  *********************************************************************/
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);
+struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);

 #ifdef CONFIG_CPU_FREQ
 /* query the current CPU frequency (in kHz). If zero, cpufreq
couldn't detect it */

  reply	other threads:[~2013-03-20  5:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  7:37 [PATCH V3 0/4] CPUFreq: Implement per policy instances of governors Viresh Kumar
2013-03-04  7:37 ` [PATCH V3 1/4] cpufreq: Add per policy governor-init/exit infrastructure Viresh Kumar
2013-03-04  7:37 ` [PATCH V3 2/4] cpufreq: governor: Implement per policy instances of governors Viresh Kumar
2013-03-20  5:29   ` Viresh Kumar [this message]
2013-03-21 23:44     ` Rafael J. Wysocki
2013-03-22  2:20       ` Viresh Kumar
2013-03-22 11:55         ` Rafael J. Wysocki
2013-03-22 11:51           ` Viresh Kumar
2013-03-22 12:11             ` Rafael J. Wysocki
2013-03-22 12:05               ` Viresh Kumar
2013-03-26 15:20       ` Jacob Shin
2013-03-26 19:32         ` Viresh Kumar
2013-03-26 19:48           ` Jacob Shin
2013-03-27  4:29             ` Viresh Kumar
2013-03-27 10:04               ` Viresh Kumar
2013-03-27 11:35                 ` Viresh Kumar
2013-03-27 14:37                   ` Viresh Kumar
2013-03-04  7:37 ` [PATCH V3 3/4] cpufreq: Get rid of "struct global_attr" Viresh Kumar
2013-03-04  7:37 ` [PATCH V3 4/4] cpufreq: Add Kconfig option to enable/disable have_multiple_policies Viresh Kumar
2013-03-11 23:38   ` Rafael J. Wysocki
2013-03-12  0:55     ` Viresh Kumar
2013-03-13 21:41       ` Rafael J. Wysocki
2013-03-14  3:09         ` Viresh Kumar
2013-03-20  0:20           ` Rafael J. Wysocki
2013-03-20  4:23             ` Viresh Kumar
2013-03-20  5:16               ` 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='CAKohponTZ29BX6CrUvFMy9RXV==0wRFu4C-W1xd6t1RmLASTvQ@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=Steve.Bannister@arm.com \
    --cc=charles.garcia-tobin@arm.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=robin.randhawa@arm.com \
    /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).