View previous topic :: View next topic |
Author |
Message |
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Sun Nov 27, 2005 5:01 pm Post subject: CPU Frequency Scalling? |
|
|
I know that my CPU supports it, since it works under Windows and CPU Frequency Scaling Monitor under Ubuntu Live CD also shows it scaling down to 50% when idle.
However after I installed Gentoo, the CPU Frequency Scaling Monitor in Gnome is always 100%, so I am wondering how do I get the CPU Freq Scaling to work? Do I need to re-compile the kernel?
Thanks. |
|
Back to top |
|
|
dgaffuri Advocate
Joined: 05 Jun 2005 Posts: 2078 Location: Italy
|
Posted: Sun Nov 27, 2005 5:13 pm Post subject: |
|
|
Probably. If you need help post the output of
Code: | cat /proc/cpuinfo
dmesg | grep -i cpu |
_________________ Adopt an unanswered post
If you feel that your problem has been solved please edit the top post and add [solved] to the subject |
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Sun Nov 27, 2005 5:14 pm Post subject: |
|
|
Yes, you have to enable it in the kernel.
Here you find the mini-howto. It doesn't matter if it's on a laptop or a desktop ... |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Mon Nov 28, 2005 2:33 pm Post subject: |
|
|
Umm well maybe that how-to is a little outdated? My make menuconfig is slightly different:
Code: | â--- Power Management support â â
â â[*] Power Management Debug Support â â
â â ACPI (Advanced Configuration and Power Interface) Support ---> â â
â â CPU Frequency scaling ---> |
And
Code: | [*] CPU Frequency scaling â â
â â [ ] Enable CPUfreq debugging â â
â â <*> CPU frequency translation statistics â â
â â [*] CPU frequency translation statistics details â â
â â Default CPUFreq governor (performance) ---> â â
â â --- 'performance' governor â â
â â < > 'powersave' governor â â
â â <*> 'userspace' governor for userspace frequency scaling â â
â â <*> 'ondemand' cpufreq policy governor â â
â â < > 'conservative' cpufreq governor |
I probably have it enabled in the kernel though... but it still doesn't seem to work... I have installed cpufreqd thing and it is running. |
|
Back to top |
|
|
tSp Apprentice
Joined: 19 Jan 2004 Posts: 214 Location: Maysville, KY
|
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Mon Nov 28, 2005 2:55 pm Post subject: |
|
|
Where is #CONFIG_SMP? |
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Mon Nov 28, 2005 2:55 pm Post subject: |
|
|
I think you have to enable the 'powersafe' governor.
Maybe this topic helps ... |
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Mon Nov 28, 2005 2:57 pm Post subject: |
|
|
Sunnz wrote: | Where is #CONFIG_SMP? |
In your .config from the kernel. |
|
Back to top |
|
|
tSp Apprentice
Joined: 19 Jan 2004 Posts: 214 Location: Maysville, KY
|
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Mon Nov 28, 2005 3:41 pm Post subject: |
|
|
tSp wrote: | Sunnz wrote: | Where is #CONFIG_SMP? |
when you configure your kernel, make sure you dont enable Symmetric multi-processing support. I read in the gentoo power-management-guide that this will not allow the cpu to be throttled on laptops, and actually verified this was a problem on mine until I disabled it. http://www.gentoo.org/doc/en/power-management-guide.xml |
Doesn't that give problems with dualcore processors? The kernel needs SMP to get the second core working. |
|
Back to top |
|
|
e-ipi Apprentice
Joined: 23 Aug 2005 Posts: 192
|
Posted: Mon Nov 28, 2005 4:09 pm Post subject: |
|
|
If you make menuconfig, you'll see someting like this under the Processor menu:
Code: |
[*] CPU Frequency scaling
[ ] Enable CPUfreq debugging
<M> CPU frequency translation statistics
[ ] CPU frequency translation statistics details
Default CPUFreq governor (userspace) --->
<M> 'performance' governor
<M> 'powersave' governor
--- 'userspace' governor for userspace frequency scaling
<M> 'ondemand' cpufreq policy governor
<M> 'conservative' cpufreq governor
|
You may also need to configure cpufreqd or powernowd or some other user space tool to use this stuff to maximum effect. Note also that sometimes there are problems with the cpufreq stuff on specific machines. Of course, if it worked before, you're probably OK in that regard. |
|
Back to top |
|
|
Zakharov n00b
Joined: 05 Sep 2005 Posts: 37 Location: Aschaffenburg, Germany
|
Posted: Mon Nov 28, 2005 4:29 pm Post subject: |
|
|
I have a simple setup, but it works excellently.. (Athlon 64 3200+)
From my .config:
Code: | #
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_POWERNOW_K8=y
CONFIG_X86_POWERNOW_K8_ACPI=y |
What's important is the 'ondemand' part. It adapts the processor speed dynamically to the current workload.
To activate it, simply put
Code: | echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
in your /etc/conf.d/local.start.
That's it. Works for me, hope it helps =) |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Mon Nov 28, 2005 11:22 pm Post subject: |
|
|
I am REALLY confused... should I edit .config file by hand or should I use make menuconfig? |
|
Back to top |
|
|
dgaffuri Advocate
Joined: 05 Jun 2005 Posts: 2078 Location: Italy
|
Posted: Mon Nov 28, 2005 11:24 pm Post subject: |
|
|
NEVER edit .config by hand. You should use make menuconfig. Type / followed by symbol name (without CONFIG_) to get help and the menu path for it. _________________ Adopt an unanswered post
If you feel that your problem has been solved please edit the top post and add [solved] to the subject |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Tue Nov 29, 2005 5:35 am Post subject: |
|
|
Ok I think I got it working, it is on "power save" now which lets me choose a speed... now, how do I change it to "ondemand"?
Thanks very much guys! |
|
Back to top |
|
|
dgaffuri Advocate
Joined: 05 Jun 2005 Posts: 2078 Location: Italy
|
Posted: Tue Nov 29, 2005 6:54 am Post subject: |
|
|
Zakharov wrote: | Code: | echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
|
If you emerge cpufrequtils you may change the default governor at startup in /etc/conf.d/cpufrequtils (adding /etc/init.d/cpufrequtils to the default runlevel), and later with the
Code: | cpufreq-set -g ondemand |
command. _________________ Adopt an unanswered post
If you feel that your problem has been solved please edit the top post and add [solved] to the subject |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Tue Nov 29, 2005 12:16 pm Post subject: |
|
|
sudo echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
bash: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: Permission denied
I already have cpufreqd... what is cpufrequtil? Is it necessary? |
|
Back to top |
|
|
jamapii l33t
Joined: 16 Sep 2004 Posts: 637
|
Posted: Thu Dec 01, 2005 2:48 pm Post subject: |
|
|
Sunnz wrote: | sudo echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
the '>' redirection is outside sudo. Try something like
sudo sh -c "echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Thu Dec 01, 2005 3:53 pm Post subject: |
|
|
Ohh, I didn't know that there are things that are "outside of sudo"!!!
Cool, it is ondemand now! However the lowest it goes down to is 90%... is that really how fast it needs to be or??? (I saw it go down to 50% on Ubuntu Live CD.) |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Fri Dec 02, 2005 11:28 am Post subject: |
|
|
Well scaling_govener goes back to powersave when reboot... where do I setup the pernement setting? Is it in the kernel? |
|
Back to top |
|
|
Zakharov n00b
Joined: 05 Sep 2005 Posts: 37 Location: Aschaffenburg, Germany
|
Posted: Fri Dec 02, 2005 1:23 pm Post subject: |
|
|
Zakharov wrote: | [...] simply put
Code: | echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
in your /etc/conf.d/local.start. |
plus rc-update add local default if you have previously unset it. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Fri Dec 02, 2005 4:24 pm Post subject: |
|
|
You may want to try out cpufreqd. That is what I use on my laptop to speedstep. |
|
Back to top |
|
|
Sunnz Guru
Joined: 18 Jun 2005 Posts: 370
|
Posted: Sat Dec 03, 2005 9:47 am Post subject: |
|
|
mikegpitt wrote: | You may want to try out cpufreqd. That is what I use on my laptop to speedstep. | I do have cpufreqd running, but how do I set it to ondemand? |
|
Back to top |
|
|
s0lar n00b
Joined: 07 Apr 2005 Posts: 55
|
Posted: Mon Dec 05, 2005 5:29 pm Post subject: |
|
|
I just installed everything according to the powermanagement guide plus installed laptop_mode_tools, I have set it to control the clock speed so when I plug out my adapter my cpu clocks back to 800Mhz.
Only it does that after I outplug it twice instead of once. Meaning I have to plug it out, plug it in and then plug it out again. Very stupid.
cat /proc/sys/vm/laptop_mode says 2 and
this are my acpi events: tail -f /var/log/sys/acpid | grep "received event" says this when I plug my adapter in and it says
"ac_adapter AC 00000080 00000001"
"processor CPU0 00000080 000000" and
"battery BAT0 00000080 00000001"
This is what I get when I plug my adapter out
"ac_adapter AC 00000080 00000000"
"processor CPU0 00000080 000000" and
"battery BAT0 00000080 00000001".
I have made the files /etc/acpi/events/pmg_ac_adapter containing the AC 00000080 00000001
and the /etc/..../pmg_battery containing BAT0 00000080 00000001.
Do I have to change those files, should I change or add some other files not in the guide?
Thanks in advance. |
|
Back to top |
|
|
Dikkiedik Guru
Joined: 04 Oct 2004 Posts: 406 Location: Netherlands
|
Posted: Wed Dec 28, 2005 11:57 pm Post subject: |
|
|
I'm also busy with powermanagement.
I'm also wondering how to configure cpufreqd. I've got it in my runlevel.
I have a hyperthreading capable machine and I've disabled it in the kernel.
I'll disable it in BIOS to as I normaly enable it there also for Windows XP.
I love this topic . _________________ Calling atheism a religion, is like calling bald a haircolour. |
|
Back to top |
|
|
|