From patchwork Wed Mar 20 05:29:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2305271 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0A50C3FC54 for ; Wed, 20 Mar 2013 05:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757725Ab3CTF3P (ORCPT ); Wed, 20 Mar 2013 01:29:15 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:35656 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757615Ab3CTF3O (ORCPT ); Wed, 20 Mar 2013 01:29:14 -0400 Received: by mail-ob0-f180.google.com with SMTP id ef5so1204355obb.25 for ; Tue, 19 Mar 2013 22:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=uPoiJWn5uul9PORgQhtwJpk67485AlFfOyQqsh2basY=; b=PALeadC/OcjNIxaLkG/p9t9dGGYA23TAsjX1AS4kFPzO8adLz2bu43JTlciFEFDv2M R8X+are8zU/x4+ZWHzagaPXBZh2odmvmaluT+faEqNA/M1caEH/9K6Fxzmf7dNneEg4E C6BPvHx25BdNukz1DOE2suXj+hY7vBgUI+B5+BYCRlCctMCK8q5bqmI0EobkNu93cmcY D71QLL3UB/Q4uKrBHtD7vw2CzRh2DjfreJMy7T1XijnGDiMQWq3g/O86hoP7QLaXQbQa VJ2m4xBMobdQHEIuT2HOP6OXYjjBPYZ5vs392rUEswS5whxHrKOJtP43JCVAkTG92dY5 jZlA== MIME-Version: 1.0 X-Received: by 10.182.1.10 with SMTP id 10mr3294879obi.15.1363757353619; Tue, 19 Mar 2013 22:29:13 -0700 (PDT) Received: by 10.182.88.196 with HTTP; Tue, 19 Mar 2013 22:29:13 -0700 (PDT) In-Reply-To: <0823a96fea2d8284b7d83cee390dd5973fdaaa94.1362381470.git.viresh.kumar@linaro.org> References: <0823a96fea2d8284b7d83cee390dd5973fdaaa94.1362381470.git.viresh.kumar@linaro.org> Date: Wed, 20 Mar 2013 10:59:13 +0530 Message-ID: Subject: Re: [PATCH V3 2/4] cpufreq: governor: Implement per policy instances of governors From: Viresh Kumar 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 X-Gm-Message-State: ALoCoQm2Ezt/zvp0C5NiXaCpES45soZnwG4gJ1t6HnajqFFRATylfNefhYGAOe7+HxqZ+qKFByQ3 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 4 March 2013 13:07, Viresh Kumar 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 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 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(-) #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/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 */ -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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/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 *******************/