LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 10-24-2005, 09:57 PM   #1
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 32
cpufreqd issues


Hi everyone. I'm having a little trouble setting up cpu frequency scaling on my Latitude D610. It's running Gentoo.

Essentially I want the laptop to work at full speed when plugged into an AC outlet. When running on battery, I'd like the laptop to switch to the lowest frequency (800MHz) but allow me to change the frequency whenever I wish (NOT dynamically, I'll decide when I need more speed). When it's on battery but the battery is low, it should switch to the lowest frequency and stay there.

cpufreqd.conf:
Code:
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
pm_type=acpi
verbosity=5

[Profile]
name=userspace
minfreq=800000
maxfreq=2000000
policy=userspace

[Profile]
name=powersave
minfreq=800000
maxfreq=2000000
policy=powersave

[Profile]
name=performance
minfreq=800000
maxfreq=2000000
policy=performance

[Rule]
name=battery
ac=off
profile=userspace

[Rule]
name=battery_low
ac=off
battery_interval=0-10
profile=powersave

[Rule]
name=ac
ac=on
profile=performance
Output of cpufreq-info when running on AC (works fine):
Code:
darkstar etc # cpufreq-info
cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
  driver: centrino
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 800 MHz - 2.00 GHz
  available frequency steps: 2.00 GHz, 1.60 GHz, 1.33 GHz, 1.07 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, powersave, userspace, performance
  current policy: frequency should be within 800 MHz and 2.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.00 GHz (asserted by call to hardware).
Output of cpufreq-inf when running on battery (NOT fine):
Code:
darkstar etc # cpufreq-info
cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
  driver: centrino
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 800 MHz - 2.00 GHz
  available frequency steps: 2.00 GHz, 1.60 GHz, 1.33 GHz, 1.07 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, powersave, userspace, performance
  current policy: frequency should be within 800 MHz and 800 MHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).
I'm limited between 800MHz and 800MHz when on batteries. I'd like that to be between 800MHz and 2GHz so that I can change it when I wish.

Any ideas?

Also, cpufreqd seems to be taking up a lot of cpu-cycles. According to htop cpufreqd keeps jumping between 0% and ~30% cpu usage (with middle values). Is this normal?

Thanks.
 
Old 10-25-2005, 02:47 PM   #2
ro_nicu
LQ Newbie
 
Registered: Oct 2004
Distribution: Slackware, Mandrake
Posts: 27

Rep: Reputation: 15
one solution would be setting the power profiles in the KDE utility ( klaptop). set it to powersave for runing on batery and performance for AC Adapter.
THAT'S IF YOU RUN K
 
Old 10-25-2005, 09:11 PM   #3
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Original Poster
Rep: Reputation: 32
I don't run KDE (nor GNOME). Though I don't know much about how KDE does things, I doubt that it has its own cpu frequency scaling. It probably tries to use cpufreqd or whatever is installed.
 
Old 10-27-2005, 12:06 PM   #4
biophysics
Member
 
Registered: Jan 2002
Location: Germany
Distribution: Kubuntu
Posts: 444

Rep: Reputation: 30
Can you post your processor info: Is it a Pentium M
 
Old 10-28-2005, 02:03 AM   #5
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Original Poster
Rep: Reputation: 32
Yes, it is a Pentium M

Code:
lithium@darkstar ~ $ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 2.00GHz
stepping        : 8
cpu MHz         : 1995.576
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx est tm2
bogomips        : 3940.35
However, I don't think this is a hardware or BIOS issue. When I run cpufreq-set -u 2GHz to set the upper limit of the policy to 2GHz, I get exactly what I want. The only problem is that I'd like cpufreqd to do this automatically.

Code:
darkstar lithium # cpufreq-set -u 2GHz
darkstar lithium # cpufreq-info 
cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
  driver: centrino
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 800 MHz - 2.00 GHz
  available frequency steps: 2.00 GHz, 1.60 GHz, 1.33 GHz, 1.07 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, powersave, userspace, performance
  current policy: frequency should be within 800 MHz and 2.00 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).

Last edited by shellcode; 10-28-2005 at 02:25 AM.
 
Old 10-28-2005, 05:39 AM   #6
biophysics
Member
 
Registered: Jan 2002
Location: Germany
Distribution: Kubuntu
Posts: 444

Rep: Reputation: 30
Quote:
Originally posted by shellcode
[B]Yes, it is a Pentium M
In that case download a latest kernel or do you have a kernel newer than 2.6.13. Just recompile it with:
Ondemand ----> governor

This will automatically control the CPU frequency. (i.e) the kernel controls everything. Just __uninstall__ your cpufreq daemon. The in-kernel cpufreq governors have made big steps forward in terms of features and usability (according to experts).

Read this small __USEFUL__ presentation regarding the same (PDF file):
http://www.brodo.de/linux/lt05/presentation.pdf

(more stuff in http://www.brodo.de/)

Also KDE/GNOME/any desktop environment has (directly) nothing to do with speed controls. They are only __frontends__ to help user.

Last edited by biophysics; 10-28-2005 at 05:44 AM.
 
Old 10-28-2005, 01:11 PM   #7
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Original Poster
Rep: Reputation: 32
Quote:
Originally posted by biophysics
In that case download a latest kernel or do you have a kernel newer than 2.6.13. Just recompile it with:
Ondemand ----> governor

This will automatically control the CPU frequency. (i.e) the kernel controls everything. Just __uninstall__ your cpufreq daemon. The in-kernel cpufreq governors have made big steps forward in terms of features and usability (according to experts).
Like I said in my original post, I do not want dynamic frequency scaling. I understand that this works nicely but I'd really rather decide when the frequency should change myself. What I want is to have the userspace governor allow me to change frequency between 800MHz and 2GHz when I feel the time is right. However, I can't do that if cpufreqd sets an arbitrary maximum frequency of 800 MHz (the same as the minumum frequency) contrary to what the configuration file says the maximum frequency should be.

Thanks for the reply.
 
Old 10-28-2005, 04:44 PM   #8
biophysics
Member
 
Registered: Jan 2002
Location: Germany
Distribution: Kubuntu
Posts: 444

Rep: Reputation: 30
OK then uninstall cpufreqd:
select userspace governor in your kernel:

If you are using the userspace governor, you can write to file: /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change the current speed.

# echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo
cpu MHz : 697.252
# echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo
cpu MHz : 976.152


http://www.thinkwiki.org/wiki/How_to...quency_Scaling
 
Old 10-28-2005, 05:54 PM   #9
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Original Poster
Rep: Reputation: 32
Yes, but if I unistall cpufreqd then there will be nothing to automatically take me down to 800MHz when I switch to battery power.

This is what I want cpufreqd to do:
On AC: 2GHz
On Battery: 800Mhz with userspace governor so that I can switch betwen 800Mhz and 2GHz (and intermediate values)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting CPU voltage with cpufreq/cpufreqd pafrica Linux - Laptop and Netbook 2 09-03-2005 03:04 AM
cpufreqd 1.2.2 rule TLV Linux - Laptop and Netbook 0 11-15-2004 05:30 AM
cpufreqd troubles moneyshotz Linux - Laptop and Netbook 1 07-02-2004 05:54 AM
SuSE 9.1 cpufreqd no longer loads wiresquire Linux - Distributions 2 06-26-2004 03:12 PM
how to use cpufreqd dejavu_01 Slackware 2 05-18-2004 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration