WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: misc adjustments to acpi-cpufreq

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: misc adjustments to acpi-cpufreq
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Feb 2009 20:51:06 -0800
Delivery-date: Tue, 03 Feb 2009 20:53:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1233684835 0
# Node ID 66020c204f145a11d3b6f6b13912fc3e245fccb5
# Parent  93d2193450c43e77f20764977d581e1e91cc154a
x86: misc adjustments to acpi-cpufreq

Avoid the call to check_freq() by default, since that function may
spin up to 1ms on certain systems without indicating any kind of severe
failure. This matches similar behavior in Linux.

Avoid doing a cross processor call in get_cur_val() if the current CPU
has its bit set in the mask passed in. Also use the local variable
'cpu' consistently, allowing to remove another local variable.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff -r 93d2193450c4 -r 66020c204f14 xen/arch/x86/acpi/cpufreq/cpufreq.c
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c       Tue Feb 03 18:13:22 2009 +0000
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c       Tue Feb 03 18:13:55 2009 +0000
@@ -58,6 +58,9 @@ static struct acpi_cpufreq_data *drv_dat
 
 static struct cpufreq_driver acpi_cpufreq_driver;
 
+static unsigned int __read_mostly acpi_pstate_strict;
+integer_param("acpi_pstate_strict", acpi_pstate_strict);
+
 static int check_est_cpu(unsigned int cpuid)
 {
     struct cpuinfo_x86 *cpu = &cpu_data[cpuid];
@@ -193,28 +196,27 @@ static void drv_write(struct drv_cmd *cm
 
 static u32 get_cur_val(cpumask_t mask)
 {
-    struct cpufreq_policy *policy;
     struct processor_performance *perf;
     struct drv_cmd cmd;
-    unsigned int cpu;
+    unsigned int cpu = smp_processor_id();
 
     if (unlikely(cpus_empty(mask)))
         return 0;
 
-    cpu = first_cpu(mask);
-    policy = cpufreq_cpu_policy[cpu];
-
-    if (!policy)
+    if (!cpu_isset(cpu, mask))
+        cpu = first_cpu(mask);
+
+    if (cpu >= NR_CPUS || !drv_data[cpu])
         return 0;    
 
-    switch (drv_data[policy->cpu]->cpu_feature) {
+    switch (drv_data[cpu]->cpu_feature) {
     case SYSTEM_INTEL_MSR_CAPABLE:
         cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
         cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
         break;
     case SYSTEM_IO_CAPABLE:
         cmd.type = SYSTEM_IO_CAPABLE;
-        perf = drv_data[first_cpu(mask)]->acpi_data;
+        perf = drv_data[cpu]->acpi_data;
         cmd.addr.io.port = perf->control_register.address;
         cmd.addr.io.bit_width = perf->control_register.bit_width;
         break;
@@ -393,7 +395,7 @@ static int acpi_cpufreq_target(struct cp
 
     drv_write(&cmd);
 
-    if (!check_freqs(cmd.mask, freqs.new, data)) {
+    if (acpi_pstate_strict && !check_freqs(cmd.mask, freqs.new, data)) {
         printk(KERN_WARNING "Fail transfer to new freq %d\n", freqs.new);
         return -EAGAIN;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: misc adjustments to acpi-cpufreq, Xen patchbot-unstable <=