Skip to contentSkip to conversation

Cpufreq on k8 with xen dom0

DISCUSSION geaaru 4 participants 13 messages Sep 25, 2007 – Oct 1, 2007

lore
Share & tools
lore

geaaru

author
#0 lore raw

Hi,
is there a patch for xen-source-2.6.20-r3 for use cpufreq on turion64?
I'm using xen-sources of gentoo portage.
Thanks in advance.

Bye

Ge@@ru

#1 lore raw
Quoted 5 lines

is there a patch for xen-source-2.6.20-r3 for use cpufreq on
turion64?
I'm using xen-sources of gentoo portage.
Thanks in advance.

It's still in development; there's a version available that will let you userspace tools in dom0 to monitor and control frequency changes but true ondemand dynamic scaling still needs some work.

Email me privately if you're interested in helping and willing to be a test subject. Thanks.

-Mark Langsdorf
Operating System Research Center
AMD

#2 lore raw
Quoted 10 lines · Mark
Quoted 4 lines

is there a patch for xen-source-2.6.20-r3 for use cpufreq on
turion64?
I'm using xen-sources of gentoo portage.
Thanks in advance.

It's still in development; there's a version available that will let you userspace tools in dom0 to monitor and control frequency changes but true ondemand dynamic scaling still needs some work.

Quoted 6 lines

Email me privately if you're interested in helping and willing to be a test subject. Thanks.

-Mark Langsdorf
Operating System Research Center
AMD

I'm verry interested. I have xen on my laptop and when on battery mode that totaly drains power. So when traveling I have to boot non XEN limiting me to dom0.

It shouldn't be too hard to write a little application that will scale frequency depending on the sum of cpu usage of all domains. The info is shown in xentop so it should be simple of sampling that once every X second and sclaing for it.

But even a simple "make it slow" option would be just fine.

MfG
Goswin

#3 lore raw
Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

is there a patch for xen-source-2.6.20-r3 for use cpufreq on
turion64?
I'm using xen-sources of gentoo portage.
Thanks in advance.

Quoted 7 lines

It's still in development; there's a version available that will let you userspace tools in dom0 to monitor and control frequency changes but true ondemand dynamic scaling still needs some work.

Email me privately if you're interested in helping and willing to be a test subject. Thanks.

I'm verry interested. I have xen on my laptop and when on battery mode that totaly drains power. So when traveling I have to boot non XEN limiting me to dom0.

Quoted 6 lines

It shouldn't be too hard to write a little application that will scale frequency depending on the sum of cpu usage of all domains. The info is shown in xentop so it should be simple of sampling that once every X second and sclaing for it.

But even a simple "make it slow" option would be just fine.

The current version of xen-unstable.hg has Keir's rewrite of most of Rik's and my code for support PowerNow!. A dom0 with cpufreq support enabled can use the performance, powersave, and userspace governors to change frequency.

You'll need to build the latest repository of xen-unstable.hg and linux-2.6.18.hg with the cpufreq build config options enabled, and pass "cpufreq" on the Xen command line. Power management should come up normally, and running echo "powersave" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor should force the system to minimum power. The same command with "performance" should set it to maximum power. The same command with "userspace" will create a /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed file, and writing a frequency value to that will cause the system to move to the nearest supported frequency to that value. A usermode daemon like cpuspeed
(http://carlthompson.net/Software/CPUSpeed)
can be modified to use the Xen getcpuinfo sysctl to read the Xen usage values and write to the scaling_setspeed file, though I haven't had time to do that yet.

The ondemand governor won't be supported unless getcpuinfo becomes a platform op hypercall. Rik, what's the status on that?

-Mark Langsdorf
Operating System Research Center
AMD

author
#4 lore raw

Hi, i try to use xen-unstable.hg version but doesn't work.

Quoted 1 line

From dmesg i have this error:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)
powernow-k8: BIOS error - no PSB or ACPI _PSS objects
ACPI: (supports S0 S3 S4 S5)

While, if i try to call cpufreq-info i have this output:

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to [email protected], please. analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU

any idea how can i resolve this problem?

Thanks

Quoted 55 lines · Mark
Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

is there a patch for xen-source-2.6.20-r3 for use cpufreq on
turion64?
I'm using xen-sources of gentoo portage.
Thanks in advance.

Quoted 7 lines

It's still in development; there's a version available that will let you userspace tools in dom0 to monitor and control frequency changes but true ondemand dynamic scaling still needs some work.

Email me privately if you're interested in helping and willing to be a test subject. Thanks.

I'm verry interested. I have xen on my laptop and when on battery mode that totaly drains power. So when traveling I have to boot non XEN limiting me to dom0.

Quoted 6 lines

It shouldn't be too hard to write a little application that will scale frequency depending on the sum of cpu usage of all domains. The info is shown in xentop so it should be simple of sampling that once every X second and sclaing for it.

But even a simple "make it slow" option would be just fine.

The current version of xen-unstable.hg has Keir's rewrite of most of Rik's and my code for support PowerNow!. A dom0 with cpufreq support enabled can use the performance, powersave, and userspace governors to change frequency.

You'll need to build the latest repository of xen-unstable.hg and linux-2.6.18.hg with the cpufreq build config options enabled, and pass "cpufreq" on the Xen command line. Power management should come up normally, and running echo "powersave" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor should force the system to minimum power. The same command with "performance" should set it to maximum power. The same command with "userspace" will create a /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed file, and writing a frequency value to that will cause the system to move to the nearest supported frequency to that value. A usermode daemon like cpuspeed
(http://carlthompson.net/Software/CPUSpeed)
can be modified to use the Xen getcpuinfo sysctl to read the Xen usage values and write to the scaling_setspeed file, though I haven't had time to do that yet.

The ondemand governor won't be supported unless getcpuinfo becomes a platform op hypercall. Rik, what's the status on that?

-Mark Langsdorf
Operating System Research Center
AMD

#5 lore raw
Quoted 10 lines

Hi, i try to use xen-unstable.hg version but doesn't work.

Quoted 1 line

From dmesg i have this error:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)
powernow-k8: BIOS error - no PSB or ACPI _PSS objects
ACPI: (supports S0 S3 S4 S5)

Quoted 8 lines

While, if i try to call cpufreq-info i have this output:

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to [email protected], please. analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU

any idea how can i resolve this problem?

dom0 isn't seeing the ACPI _PSS objects (I thought the error message made that clear). No ACPI objects means no information on the pstates.

Do you get PowerNow! support on a native version 2.6.21+ kernel? If not, you need to update your BIOS to something that supports pstates (or possibly you have one of the rare Turions that doesn't support more than 1 pstate, but I doubt that).

If 2.6.21+ native works, check to see if 2.6.18 native works. If it doesn't, then there was a change to the ACPI interpreter to support your laptop that will need to be backported. If 2.6.18 native works, then there's a difference between the Xen ACPI interpreter and the native mode interpreter that will need to be ported to Xen.

-Mark Langsdorf
Operating System Research Center
AMD

author
#6 lore raw

My current kernel version 2.6.22 (as previous versions 2.6.21, 2.6.20) native works fine. Probably, there is a difference (as you said me) between Xen ACPI Interpreter and the native mode interpreter. I try also with xen-source-2.6.18 tree without xen support and in this case, cpufreq works fine. Only if i enable xen cpufreq doesn't work.

Quoted 40 lines · Mark
Quoted 9 lines

Hi, i try to use xen-unstable.hg version but doesn't work.

Quoted 1 line

From dmesg i have this error:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)
powernow-k8: BIOS error - no PSB or ACPI _PSS objects
ACPI: (supports S0 S3 S4 S5)

Quoted 8 lines

While, if i try to call cpufreq-info i have this output:

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to [email protected], please. analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU

any idea how can i resolve this problem?

dom0 isn't seeing the ACPI _PSS objects (I thought the error message made that clear). No ACPI objects means no information on the pstates.

Do you get PowerNow! support on a native version 2.6.21+ kernel? If not, you need to update your BIOS to something that supports pstates (or possibly you have one of the rare Turions that doesn't support more than 1 pstate, but I doubt that).

If 2.6.21+ native works, check to see if 2.6.18 native works. If it doesn't, then there was a change to the ACPI interpreter to support your laptop that will need to be backported. If 2.6.18 native works, then there's a difference between the Xen ACPI interpreter and the native mode interpreter that will need to be ported to Xen.

-Mark Langsdorf
Operating System Research Center
AMD

#7 lore raw
Quoted 5 lines

My current kernel version 2.6.22 (as previous versions 2.6.21, 2.6.20) native works fine. Probably, there is a difference (as you said me) between Xen ACPI Interpreter and the native mode interpreter. I try also with xen-source-2.6.18 tree without xen support and in this case, cpufreq works fine. Only if i enable xen cpufreq doesn't work.

That's really strange.

What do you get when you have cpufreq.debug=2 on the command line?

-Mark Langsdorf
Operating System Research Center
AMD

author
#8 lore raw

I have done another test: i insert powernow-k8 driver as module not built-in and now when i try to insert powernow-k8 kernel module i have a segfault (but seems that so, before do a segfault found cpu frequencies:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)

powernow-k8:    0 : fid 0x8, vid 0x4
powernow-k8:    1 : fid 0x0, vid 0x16
powernow-k8:    0 : fid 0x8 (1600 MHz), vid 0x4
powernow-k8:    1 : fid 0x0 (800 MHz), vid 0x16
general protection fault: 0000 [1] SMP 
CPU 0 
Modules linked in: powernow_k8 snd_pcm_oss snd_mixer_oss snd_seq_dummy

snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device rtc_sysfs rtc_dev rtc_proc rtc_core rtc_lib video processor ac button dm_crypt ipt_REJECT ipt_LOG xt_state nf_conntrack nfnetlink iptable_filter ip_tables x_tables pktcdvd psmouse radeon drm 8139too capability commoncap tsdev evdev usbmouse usbhid sdhci mmc_core ohci1394 ieee1394 snd_atiixp snd_atiixp_modem snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc ehci_hcd ohci_hcd
Pid: 5485, comm: modprobe Not tainted 2.6.18-xen #2

RIP: e030:[<ffffffff880a8060>]
[<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
RSP: e02b:ffff880035ecdbd0  EFLAGS: 00010297
RAX: 0000000000000000 RBX: 0000000000001600 RCX: 00000000c0010042
RDX: ffffffffff578000 RSI: 0000000000000000 RDI: ffff880001e39420
RBP: ffff880037b20200 R08: 0000000000000036 R09: 0000000000000000
R10: ffff880037b20200 R11: 0000000000000002 R12: 0000000000000001
R13: 000000000000000f R14: ffff8800367308c0 R15: ffff880036522730
FS:  00002b9b7af5bae0(0000) GS:ffffffff806fc000(0000)

knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000
Process modprobe (pid: 5485, threadinfo ffff880035ecc000, task ffff8800009bd040)

Stack:  ffffffff880a9d85 ffff880035ecdc68 0000000000000060
ffff8800367308f8
 00000001349ebf08 ffff880036522720 ffff880036522720 0000000000000002
 0000000000000060 0000000100000001 ffffffff807741e8 ffffffff806a30a0
Call Trace:
 [<ffffffff880a9d85>] :powernow_k8:powernowk8_cpu_init+0xb45/0xdd0
 [<ffffffff804e4884>] cpufreq_add_dev+0x174/0x540
 [<ffffffff8022b6e3>] __wake_up+0x43/0x70
 [<ffffffff8020d540>] monotonic_clock+0x50/0xa0
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff804304f6>] sysdev_driver_register+0x96/0x100
 [<ffffffff804e3947>] cpufreq_register_driver+0xc7/0x1b0
 [<ffffffff80253faf>] sys_init_module+0x189f/0x1aa0
 [<ffffffff8020a2ee>] system_call+0x86/0x8b
 [<ffffffff8020a268>] system_call+0x0/0x8b


Code: 0f 32 c1 e8 1f f3 c3 66 66 90 66 66 90 66 66 90 8b 57 60 85 
RIP  [<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
 RSP <ffff880035ecdbd0>
Quoted 14 lines · Mark
Quoted 5 lines

My current kernel version 2.6.22 (as previous versions 2.6.21, 2.6.20) native works fine. Probably, there is a difference (as you said me) between Xen ACPI Interpreter and the native mode interpreter. I try also with xen-source-2.6.18 tree without xen support and in this case, cpufreq works fine. Only if i enable xen cpufreq doesn't work.

That's really strange.

What do you get when you have cpufreq.debug=2 on the command line?

-Mark Langsdorf
Operating System Research Center
AMD

#9 lore raw
Quoted 48 lines · geaaru

I have done another test: i insert powernow-k8 driver as module not built-in and now when i try to insert powernow-k8 kernel module i have a segfault (but seems that so, before do a segfault found cpu frequencies:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)

powernow-k8:    0 : fid 0x8, vid 0x4
powernow-k8:    1 : fid 0x0, vid 0x16
powernow-k8:    0 : fid 0x8 (1600 MHz), vid 0x4
powernow-k8:    1 : fid 0x0 (800 MHz), vid 0x16
general protection fault: 0000 [1] SMP 
CPU 0 
Modules linked in: powernow_k8 snd_pcm_oss snd_mixer_oss snd_seq_dummy

snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device rtc_sysfs rtc_dev rtc_proc rtc_core rtc_lib video processor ac button dm_crypt ipt_REJECT ipt_LOG xt_state nf_conntrack nfnetlink iptable_filter ip_tables x_tables pktcdvd psmouse radeon drm 8139too capability commoncap tsdev evdev usbmouse usbhid sdhci mmc_core ohci1394 ieee1394 snd_atiixp snd_atiixp_modem snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc ehci_hcd ohci_hcd
Pid: 5485, comm: modprobe Not tainted 2.6.18-xen #2

RIP: e030:[<ffffffff880a8060>]
[<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
RSP: e02b:ffff880035ecdbd0  EFLAGS: 00010297
RAX: 0000000000000000 RBX: 0000000000001600 RCX: 00000000c0010042
RDX: ffffffffff578000 RSI: 0000000000000000 RDI: ffff880001e39420
RBP: ffff880037b20200 R08: 0000000000000036 R09: 0000000000000000
R10: ffff880037b20200 R11: 0000000000000002 R12: 0000000000000001
R13: 000000000000000f R14: ffff8800367308c0 R15: ffff880036522730
FS:  00002b9b7af5bae0(0000) GS:ffffffff806fc000(0000)

knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000
Process modprobe (pid: 5485, threadinfo ffff880035ecc000, task ffff8800009bd040)

Stack:  ffffffff880a9d85 ffff880035ecdc68 0000000000000060
ffff8800367308f8
 00000001349ebf08 ffff880036522720 ffff880036522720 0000000000000002
 0000000000000060 0000000100000001 ffffffff807741e8 ffffffff806a30a0
Call Trace:
 [<ffffffff880a9d85>] :powernow_k8:powernowk8_cpu_init+0xb45/0xdd0
 [<ffffffff804e4884>] cpufreq_add_dev+0x174/0x540
 [<ffffffff8022b6e3>] __wake_up+0x43/0x70
 [<ffffffff8020d540>] monotonic_clock+0x50/0xa0
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff804304f6>] sysdev_driver_register+0x96/0x100
 [<ffffffff804e3947>] cpufreq_register_driver+0xc7/0x1b0
Quoted 9 lines
 [<ffffffff80253faf>] sys_init_module+0x189f/0x1aa0
 [<ffffffff8020a2ee>] system_call+0x86/0x8b
 [<ffffffff8020a268>] system_call+0x0/0x8b


Code: 0f 32 c1 e8 1f f3 c3 66 66 90 66 66 90 66 66 90 8b 57 60 85 
RIP  [<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
 RSP <ffff880035ecdbd0>

It seems you forgot to pass cpufreq option to xen hypervisor.

I have tested cpufreq patchset for K8 and it works fine. Frequencies successfully switches from userspace. But i have tested it not long time.

Signature · 2 lines
View this message in context: http://www.nabble.com/Cpufreq-on-k8-with-xen-dom0-tf4515569.html#a12960971
Sent from the Xen - Dev mailing list archive at Nabble.com.
#10 lore raw

But there is clock glitches as on domo as on dumU.

# while true; do date; done;
....
12:10:01
12:10:01
12:10:01
12:10:02
12:10:02
12:10:02
12:10:02
<here freq was changed>
12:10:01
12:10:02
12:10:03
12:10:03
12:10:03
.....
Signature · 2 lines
View this message in context: http://www.nabble.com/Cpufreq-on-k8-with-xen-dom0-tf4515569.html#a12974728
Sent from the Xen - Dev mailing list archive at Nabble.com.
author
#11 lore raw
In reply to xeb
Quoted 55 lines · xeb
Quoted 53 lines · geaaru

I have done another test: i insert powernow-k8 driver as module not built-in and now when i try to insert powernow-k8 kernel module i have a segfault (but seems that so, before do a segfault found cpu frequencies:

powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology ML-30 processors (version 2.00.00)

powernow-k8:    0 : fid 0x8, vid 0x4
powernow-k8:    1 : fid 0x0, vid 0x16
powernow-k8:    0 : fid 0x8 (1600 MHz), vid 0x4
powernow-k8:    1 : fid 0x0 (800 MHz), vid 0x16
general protection fault: 0000 [1] SMP 
CPU 0 
Modules linked in: powernow_k8 snd_pcm_oss snd_mixer_oss snd_seq_dummy

snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device rtc_sysfs rtc_dev rtc_proc rtc_core rtc_lib video processor ac button dm_crypt ipt_REJECT ipt_LOG xt_state nf_conntrack nfnetlink iptable_filter ip_tables x_tables pktcdvd psmouse radeon drm 8139too capability commoncap tsdev evdev usbmouse usbhid sdhci mmc_core ohci1394 ieee1394 snd_atiixp snd_atiixp_modem snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc ehci_hcd ohci_hcd
Pid: 5485, comm: modprobe Not tainted 2.6.18-xen #2

RIP: e030:[<ffffffff880a8060>]
[<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
RSP: e02b:ffff880035ecdbd0  EFLAGS: 00010297
RAX: 0000000000000000 RBX: 0000000000001600 RCX: 00000000c0010042
RDX: ffffffffff578000 RSI: 0000000000000000 RDI: ffff880001e39420
RBP: ffff880037b20200 R08: 0000000000000036 R09: 0000000000000000
R10: ffff880037b20200 R11: 0000000000000002 R12: 0000000000000001
R13: 000000000000000f R14: ffff8800367308c0 R15: ffff880036522730
FS:  00002b9b7af5bae0(0000) GS:ffffffff806fc000(0000)

knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000
Process modprobe (pid: 5485, threadinfo ffff880035ecc000, task ffff8800009bd040)

Stack:  ffffffff880a9d85 ffff880035ecdc68 0000000000000060
ffff8800367308f8
 00000001349ebf08 ffff880036522720 ffff880036522720 0000000000000002
 0000000000000060 0000000100000001 ffffffff807741e8 ffffffff806a30a0
Call Trace:
 [<ffffffff880a9d85>] :powernow_k8:powernowk8_cpu_init+0xb45/0xdd0
 [<ffffffff804e4884>] cpufreq_add_dev+0x174/0x540
 [<ffffffff8022b6e3>] __wake_up+0x43/0x70
 [<ffffffff8020d540>] monotonic_clock+0x50/0xa0
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff805a54f5>] thread_return+0x0/0x13b
 [<ffffffff804304f6>] sysdev_driver_register+0x96/0x100
 [<ffffffff804e3947>] cpufreq_register_driver+0xc7/0x1b0
 [<ffffffff80253faf>] sys_init_module+0x189f/0x1aa0
 [<ffffffff8020a2ee>] system_call+0x86/0x8b
 [<ffffffff8020a268>] system_call+0x0/0x8b
Quoted 8 lines
Quoted 4 lines
Code: 0f 32 c1 e8 1f f3 c3 66 66 90 66 66 90 66 66 90 8b 57 60 85 
RIP  [<ffffffff880a8060>] :powernow_k8:pending_bit_stuck+0x10/0x20
 RSP <ffff880035ecdbd0>

It seems you forgot to pass cpufreq option to xen hypervisor.

I have tested cpufreq patchset for K8 and it works fine. Frequencies successfully switches from userspace. But i have tested it not long time.

What options i forgot, please?

This error is happened if i try to insert powernow-k8 kernel module. While, if i compile it as built-in doesn't work.

Thanks.

Ge@@ru

#12 lore raw
Quoted 7 lines · geaaru

What options i forgot, please?

This error is happened if i try to insert powernow-k8 kernel module. While, if i compile it as built-in doesn't work.

Here is my grub.conf
title Gentoo Linux (2.6.20-xen-r4)

        root (hd0,0)
        kernel /xen.gz cpufreq
        module /vmlinuz-2.6.20-xen-r4 ro root=/dev/sda6 vga=0x317

usbhid.mousepoll=2 udev

Signature · 2 lines
View this message in context: http://www.nabble.com/Cpufreq-on-k8-with-xen-dom0-tf4515569.html#a12986414
Sent from the Xen - Dev mailing list archive at Nabble.com.