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-devel

RE: [Xen-devel] [xen 3.4.2][2.6.31.6-pvops] Problems with cpufreq=xen po

To: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [xen 3.4.2][2.6.31.6-pvops] Problems with cpufreq=xen power management on amd k8 cpu
From: "Yu, Ke" <ke.yu@xxxxxxxxx>
Date: Fri, 8 Jan 2010 22:32:18 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Fri, 08 Jan 2010 06:32:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1269589227.20100107160820@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1269589227.20100107160820@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcqPq2N3MfPuJ9zdQje7eUE4Y9pHnwAhguPg
Thread-topic: [Xen-devel] [xen 3.4.2][2.6.31.6-pvops] Problems with cpufreq=xen power management on amd k8 cpu
Hi Sander,

For option1 "cpufreq=dom0-kernel", it is not working currently, the reason is a 
bit complex, and let me explain. For every processor, there is corresponding 
acpi processor object in ACPI DSDT table. Kernel use struct acpi_processor to 
represent the acpi processor object. There is a field "id" in acpi_processor 
representing the cpu id (the same id as smp_processor_id()). Kernel cpufreq use 
acpi_processor->id to do the frequency scaling. Unfortunately, in pv_ops 
domain0, the acpi_processor->id value is not correct, because it is get by 
acpi_id->apic_id->id mapping, and in pv_ops dom0, the apic_id of vcpu is not 
correctly initialized. Please see drivers/acpi/processor_core.c:get_cpu_id() 
for detail code, where cpu_physical_id() is not initialized in pv_ops dom0 
case. I am still thinking if there is better approach to do the 
acpi_id->apic_id->id mapping in pv_ops dom0 case. 

BTW, "cpufreq=dom0-kernel" is not recommend, due to that it require 
#pCPU=#vCPU, and all vCPU in dom0 must be pined.

For option2 "cpufreq=xen", from the log, Xen can get all the P states info, but 
it failed to do cpufreq cpu initialization 
(xen/arch/x86/acpi/cpufreq/cpufreq.c: cpufreq_cpu_init()), so the cpufreq is 
not started finally, and xenpm cannot set cpufreq parameter. To get more debug 
info, I write a simple patch as attached, could you please have a try and send 
the debug info?

Another thing is, does "cpufreq=xen" work with linux-2.6.18-xen dom0? 

Best Regards
Ke

-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Sander Eikelenboom
Sent: Thursday, January 07, 2010 11:08 PM
To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [xen 3.4.2][2.6.31.6-pvops] Problems with cpufreq=xen 
power management on amd k8 cpu

Hi All,

I'm trying to get powermanagement working with xen and a 2.6.31.6-pvops kernel 
on xen 3.4.2
>From what I have read, I have 2 options:
1) Let the xen hypervisor do the powermanagement (cpufreq=xen)
2) Let the dom0 kernel do the powermanagement    (cpufreq=dom0-kernel)

When booting the 2.6.31.6-pvops kernel on bare metal without hypervisor the 
powernow-k8 module works.
When booting the 2.6.31.6-pvops kernel as dom0 on the xen 3.4.2 hypervisor the 
powernow-k8 module doesn't load and complains:
     Jan  7 15:25:37 localhost kernel: [   12.797914] powernow-k8: Found 1 AMD 
Athlon(tm) Dual Core Processor 4850e processors (2 cpu cores) (version 2.20.00)
     Jan  7 15:25:37 localhost kernel: [   12.797926] powernow-k8: register 
performance failed: bad ACPI data
     Jan  7 15:25:37 localhost kernel: [   12.797929] [Firmware Bug]: 
powernow-k8: No compatible ACPI _PSS objects found.
     Jan  7 15:25:37 localhost kernel: [   12.797931] [Firmware Bug]: 
powernow-k8: Try again with latest BIOS.
     Jan  7 15:25:37 localhost kernel: [   12.797941] powernow-k8: register 
performance failed: bad ACPI data
     Jan  7 15:25:37 localhost kernel: [   12.822315] acpi-cpufreq: 
acpi_cpufreq_init
     Jan  7 15:25:37 localhost kernel: [   12.822319] acpi-cpufreq: 
acpi_cpufreq_early_init
     Jan  7 15:25:37 localhost kernel: [   12.822333] acpi-cpufreq: 
acpi_cpufreq_cpu_init
     Jan  7 15:25:37 localhost kernel: [   12.822338] acpi-cpufreq: 
acpi_cpufreq_cpu_init

It could be that additional changes are needed to the pvops kernel that have 
been made to the xen 2.6.18.8 kernel ?

When trying the first option, and let the hypervisor do the powermanagement 
(booting with cpufreq=xen cpufreq.debug=2 loglvl=all)
it shows the following in xm dmesg (complete xm dmesg attachted):

(XEN) Set CPU acpi_id(0) cpuid(0) Px State info:
(XEN)   _PPC: 0
(XEN) Set CPU acpi_id(0) cpuid(0) Px State info:
(XEN)   _PCT: descriptor=130, length=12, space_id=127, bit_width=0, 
bit_offset=0, reserved=0, address=0
(XEN)   _PCT: descriptor=130, length=12, space_id=127, bit_width=0, 
bit_offset=0, reserved=0, address=0
(XEN)   _PSS: state_count=6
(XEN)   State0: 2500MHz 50000mW 100us 9us 0xe8201391 0x391
(XEN)   State1: 2400MHz 46020mW 100us 9us 0xe82013d0 0x3d0
(XEN)   State2: 2200MHz 38671mW 100us 9us 0xe820144e 0x44e
(XEN)   State3: 2000MHz 32100mW 100us 9us 0xe82014cc 0x4cc
(XEN)   State4: 1800MHz 26265mW 100us 9us 0xe820154a 0x54a
(XEN)   State5: 1000MHz 13888mW 100us 9us 0xe8201582 0x582
(XEN)   _PSD: num_entries=5 rev=0 domain=0 coord_type=253 num_processors=2
(XEN)   _PPC: 0
(XEN) Set CPU acpi_id(1) cpuid(1) Px State info:
(XEN)   _PPC: 0
(XEN) Set CPU acpi_id(1) cpuid(1) Px State info:
(XEN)   _PCT: descriptor=130, length=12, space_id=127, bit_width=0, 
bit_offset=0, reserved=0, address=0
(XEN)   _PCT: descriptor=130, length=12, space_id=127, bit_width=0, 
bit_offset=0, reserved=0, address=0
(XEN)   _PSS: state_count=6
(XEN)   State0: 2500MHz 50000mW 100us 9us 0xe8201391 0x391
(XEN)   State1: 2400MHz 46020mW 100us 9us 0xe82013d0 0x3d0
(XEN)   State2: 2200MHz 38671mW 100us 9us 0xe820144e 0x44e
(XEN)   State3: 2000MHz 32100mW 100us 9us 0xe82014cc 0x4cc
(XEN)   State4: 1800MHz 26265mW 100us 9us 0xe820154a 0x54a
(XEN)   State5: 1000MHz 13888mW 100us 9us 0xe8201582 0x582
(XEN)   _PSD: num_entries=5 rev=0 domain=0 coord_type=253 num_processors=2
(XEN)   _PPC: 0

So it seems to find all available powerstates, but using xenpm doesn't seem to 
work:

serveerstertje:~# xenpm  get-cpu-topology
CPU     core    socket
CPU0     0       0
CPU1     1       0
serveerstertje:~# xenpm  set-scaling-governor userspace
[CPU0] failed to set governor name
[CPU1] failed to set governor name
serveerstertje:~# xenpm  set-scaling-governor ondemand
[CPU0] failed to set governor name
[CPU1] failed to set governor name
serveerstertje:~# xenpm  set-scaling-governor performance
[CPU0] failed to set governor name
[CPU1] failed to set governor name
serveerstertje:~# xenpm  set-scaling-governor powersave
[CPU0] failed to set governor name
[CPU1] failed to set governor name
serveerstertje:~# xenpm  get-cpufreq-para
[CPU0] failed to get cpufreq parameter
[CPU1] failed to get cpufreq parameter


-- 
Best regards,
 Sander                          mailto:linux@xxxxxxxxxxxxxx

Attachment: cpufreq.patch
Description: cpufreq.patch

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