cpufreq.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: venkatesh.pallipadi@intel.com
To: cpufreq@www.linux.org.uk
Cc: davej@redhat.com
Subject: [patch 1/6] cpufreq: Add cpu number parameter to __cpufreq_driver_getavg()
Date: Thu, 17 Jul 2008 13:55:55 -0700	[thread overview]
Message-ID: <20080717205615.928888000@intel.com> (raw)
In-Reply-To: 20080717205554.214645000@intel.com

[-- Attachment #1: cpufreq_getavg_cpu_param.patch --]
[-- Type: text/plain, Size: 3399 bytes --]

Add a cpu parameter to __cpufreq_driver_getavg(). This is needed for software
cpufreq coordination where policy->cpu may not be same as the CPU on which we
want to getavg frequency. 

A follow-on patch will use this parameter to getavg freq from all cpus
in policy->cpus.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

---
 arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c |    5 +++++
 drivers/cpufreq/cpufreq.c                  |    6 +++---
 drivers/cpufreq/cpufreq_ondemand.c         |    2 +-
 include/linux/cpufreq.h                    |    3 ++-
 4 files changed, 11 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-2.6.orig/drivers/cpufreq/cpufreq.c	2008-07-16 10:58:51.000000000 -0700
+++ linux-2.6/drivers/cpufreq/cpufreq.c	2008-07-17 10:02:23.000000000 -0700
@@ -1482,7 +1482,7 @@ int cpufreq_driver_target(struct cpufreq
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
-int __cpufreq_driver_getavg(struct cpufreq_policy *policy)
+int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
 {
 	int ret = 0;
 
@@ -1490,8 +1490,8 @@ int __cpufreq_driver_getavg(struct cpufr
 	if (!policy)
 		return -EINVAL;
 
-	if (cpu_online(policy->cpu) && cpufreq_driver->getavg)
-		ret = cpufreq_driver->getavg(policy->cpu);
+	if (cpu_online(cpu) && cpufreq_driver->getavg)
+		ret = cpufreq_driver->getavg(cpu);
 
 	cpufreq_cpu_put(policy);
 	return ret;
Index: linux-2.6/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
--- linux-2.6.orig/drivers/cpufreq/cpufreq_ondemand.c	2008-07-16 10:58:51.000000000 -0700
+++ linux-2.6/drivers/cpufreq/cpufreq_ondemand.c	2008-07-17 10:02:23.000000000 -0700
@@ -415,7 +415,7 @@ static void dbs_check_cpu(struct cpu_dbs
 	if (load < (dbs_tuners_ins.up_threshold - 10)) {
 		unsigned int freq_next, freq_cur;
 
-		freq_cur = __cpufreq_driver_getavg(policy);
+		freq_cur = __cpufreq_driver_getavg(policy, policy->cpu);
 		if (!freq_cur)
 			freq_cur = policy->cur;
 
Index: linux-2.6/include/linux/cpufreq.h
===================================================================
--- linux-2.6.orig/include/linux/cpufreq.h	2008-07-16 10:58:51.000000000 -0700
+++ linux-2.6/include/linux/cpufreq.h	2008-07-17 10:02:23.000000000 -0700
@@ -189,7 +189,8 @@ extern int __cpufreq_driver_target(struc
 				   unsigned int relation);
 
 
-extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy);
+extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy,
+				   unsigned int cpu);
 
 int cpufreq_register_governor(struct cpufreq_governor *governor);
 void cpufreq_unregister_governor(struct cpufreq_governor *governor);
Index: linux-2.6/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c	2008-07-16 10:58:51.000000000 -0700
+++ linux-2.6/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c	2008-07-17 10:02:23.000000000 -0700
@@ -611,6 +611,11 @@ static int acpi_cpufreq_cpu_init(struct 
 	}
 #endif
 
+	/* Set drv_data for all secondary CPUs in policy->cpus mask */
+	for_each_cpu_mask(i, policy->cpus)
+		if (i != policy->cpu)
+			per_cpu(drv_data, i) = data;
+
 	/* capability check */
 	if (perf->state_count <= 1) {
 		dprintk("No P-States\n");

-- 

  reply	other threads:[~2008-07-17 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 20:55 [patch 0/6] cpufreq: Use idle micro-accounting information in ondemand governor venkatesh.pallipadi
2008-07-17 20:55 ` venkatesh.pallipadi [this message]
2008-07-17 20:55 ` [patch 2/6] cpufreq: Change load calculation in ondemand for software coordination venkatesh.pallipadi
2008-07-17 20:55 ` [patch 3/6] cpufreq: get_cpu_idle_time() changes in ondemand to suit idle-microaccounting venkatesh.pallipadi
2008-07-17 20:55 ` [patch 4/6] cpufreq_ondemand: Parameterize down differential venkatesh.pallipadi
2008-07-17 20:55 ` [patch 5/6] cpufreq: Changes to get_cpu_idle_time_us(), to be used in ondemand governor venkatesh.pallipadi
2008-07-17 20:56 ` [patch 6/6] cpufreq: Add idle microaccounting " venkatesh.pallipadi
2008-07-30 16:56 ` [patch 0/6] cpufreq: Use idle micro-accounting information " Dave Jones

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=20080717205615.928888000@intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=cpufreq@www.linux.org.uk \
    --cc=davej@redhat.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).