Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CPU Frequency Scalling?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Sun Nov 27, 2005 5:01 pm    Post subject: CPU Frequency Scalling? Reply with quote

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
View user's profile Send private message
dgaffuri
Advocate
Advocate


Joined: 05 Jun 2005
Posts: 2078
Location: Italy

PostPosted: Sun Nov 27, 2005 5:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Sun Nov 27, 2005 5:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Mon Nov 28, 2005 2:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
tSp
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 214
Location: Maysville, KY

PostPosted: Mon Nov 28, 2005 2:50 pm    Post subject: Reply with quote

also, make sure you have #CONFIG_SMP= is not set or it will not work
_________________
tSp
http://www.rhpstudios.com
http://www.xtremewebhosts.com
http://www.maysville-linux-users-group.org
http://www.edwiget.name

Registered Linux User #162711
Back to top
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Mon Nov 28, 2005 2:55 pm    Post subject: Reply with quote

Where is #CONFIG_SMP?
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Mon Nov 28, 2005 2:55 pm    Post subject: Reply with quote

I think you have to enable the 'powersafe' governor.
Maybe this topic helps ...
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Mon Nov 28, 2005 2:57 pm    Post subject: Reply with quote

Sunnz wrote:
Where is #CONFIG_SMP?

In your .config from the kernel.
Back to top
View user's profile Send private message
tSp
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 214
Location: Maysville, KY

PostPosted: Mon Nov 28, 2005 3:30 pm    Post subject: Reply with quote

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
_________________
tSp
http://www.rhpstudios.com
http://www.xtremewebhosts.com
http://www.maysville-linux-users-group.org
http://www.edwiget.name

Registered Linux User #162711
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Mon Nov 28, 2005 3:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
e-ipi
Apprentice
Apprentice


Joined: 23 Aug 2005
Posts: 192

PostPosted: Mon Nov 28, 2005 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zakharov
n00b
n00b


Joined: 05 Sep 2005
Posts: 37
Location: Aschaffenburg, Germany

PostPosted: Mon Nov 28, 2005 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Mon Nov 28, 2005 11:22 pm    Post subject: Reply with quote

I am REALLY confused... should I edit .config file by hand or should I use make menuconfig?
Back to top
View user's profile Send private message
dgaffuri
Advocate
Advocate


Joined: 05 Jun 2005
Posts: 2078
Location: Italy

PostPosted: Mon Nov 28, 2005 11:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Tue Nov 29, 2005 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
dgaffuri
Advocate
Advocate


Joined: 05 Jun 2005
Posts: 2078
Location: Italy

PostPosted: Tue Nov 29, 2005 6:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Tue Nov 29, 2005 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Thu Dec 01, 2005 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Thu Dec 01, 2005 3:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Fri Dec 02, 2005 11:28 am    Post subject: Reply with quote

Well scaling_govener goes back to powersave when reboot... where do I setup the pernement setting? Is it in the kernel?
Back to top
View user's profile Send private message
Zakharov
n00b
n00b


Joined: 05 Sep 2005
Posts: 37
Location: Aschaffenburg, Germany

PostPosted: Fri Dec 02, 2005 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Fri Dec 02, 2005 4:24 pm    Post subject: Reply with quote

You may want to try out cpufreqd. That is what I use on my laptop to speedstep.
Back to top
View user's profile Send private message
Sunnz
Guru
Guru


Joined: 18 Jun 2005
Posts: 370

PostPosted: Sat Dec 03, 2005 9:47 am    Post subject: Reply with quote

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
View user's profile Send private message
s0lar
n00b
n00b


Joined: 07 Apr 2005
Posts: 55

PostPosted: Mon Dec 05, 2005 5:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dikkiedik
Guru
Guru


Joined: 04 Oct 2004
Posts: 406
Location: Netherlands

PostPosted: Wed Dec 28, 2005 11:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum