WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Cpu frequency scaling basics  (Read 33633 times)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #15 on: August 14, 2009, 03:39:06 AM »
Did you change the governor to userspace?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Cpu frequency scaling basics
« Reply #16 on: August 14, 2009, 09:09:54 AM »
Did you change the governor to userspace?

I set the governor to "On Demand High" in the Basic section - "AC on" in the cpufreq.conf file. I assume this sets the system governor to "ondemand" as long as the computer is "plugged" into AC and is not running on batteries. When idle the coufreq-info does indeed report "ondemnd" governor active.

However, for some reason the system switches over to the performance mode when the cpu gets busy. But never beyond 1.3Ghz. Strange.

edit: Well I guess I have been a little slow to pick up the fact the cpufreqd daemon is a user space program and overrides/ conflicts with the other governors like "ondemand".

I finally got around to reading the IBM document bmarkus suggested. It states:

Code: [Select]
The "userspace governor"
Use the userspace governor if you want to impose a unique power policy that is not provided by other
kernel governors or if you want to experiment with directly setting different power policies.
This governor allows any user space program to set the processor frequency. User space daemons such as
cpuspeed control the processor speed through the userspace governor interface. Because user space
programs can react to any number of conditions or events, this governor (in conjunction with a user
space program) provides you with the most freedom in setting processor speed. The userspace governor
does not dynamically change the CPU frequency or react to processor load - it only provides a
mechanism to set the frequency (through the use of the scaling_speed parameter discussed later).
The cpuspeed program is an example of a user space program that you can use to control the processor
speed. Red Hat Enterprise Linux 5.3 provides cpuspeed and the daemon runs by default. Other example
daemons that work with the userspace governor to adjust the CPU frequency are:

cpufreqd
http://www.linux.it/~malattia/wiki/index.php/Cpufreqd (http://www.linux.it/~malattia/wiki/
index.php/Cpufreqd)

So by setting the governor to "userspace" directly in the /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor file I finally get the desired effect.

edit2 : It seems that when I edited the cpufreq.conf file I made a mistake so the cpufreqd daemon was not actually running when I got the "userspace" above results. Very interesting eh. That got me to thinking that the "ondemand" governor would run fine without the daemon and sure enough that seems to be the case. But after thinking about this some more, perhaps the bios is scaling the cpu freq and the "cat  scaling_cur_freq" is simply reporting on what the bios is doing. I'm still not sure what is going on.
« Last Edit: August 14, 2009, 10:59:50 AM by bigpcman »
big pc man

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Cpu frequency scaling basics
« Reply #17 on: August 14, 2009, 11:59:49 AM »
tc2.2 eeepc 900A

Alrighty then, it's to time to start over. I decided to reboot and start over with a simpler approach.

I installed only the "cpufreq-2.6.29.1-tinycore.tcem" extension which has no dependencies.
Next I did a "sudo modprobe acpi-cpufreq".

The modprobe installed the "/sys/devices/system/cpu/cpu0/cpufreq/" directory with all the cpufreq control and status files.
At this point the "cpufreq_governor" was set to performance by default and the cpu speed stayed at 1.6Ghz under all loads.

Next I did a "sudo modprobe cpufreq_ondemand".
Then I changed the "cpufreq_governor" to "ondemand".
Bingo! The cpu speed dropped to 800Mhz at idle and jumped to 1.6Ghz when the cpu load increased. Perfect.

Wow, somehow I got myself way offtrack on this one. In the end the solution was simple but it was a long trip to get here.
big pc man

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Cpu frequency scaling basics
« Reply #18 on: October 11, 2009, 08:13:15 PM »
Thanks for this great tutorial on power saving. I followed the aadvice on my Eee900 and was able to set up my machine for the first time in a true low-power mode. This is just what I want for reading ebooks and light web browsing.

Offline 4-stroke

  • Jr. Member
  • **
  • Posts: 72
Re: Cpu frequency scaling basics
« Reply #19 on: October 15, 2009, 02:48:51 AM »
Just as info:

I've had great success with my Acer Aspire 1360 with AMD sempron CPU by putting this in my bootlocal.sh:

Code: [Select]
modprobe powernow-k8
modprobe cpufreq_ondemand
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Of course cpufreq-2.6.29.1-tinycore.tcem is needed also.

On my Eeepc900 with the celeron processor loading the acpi-cpufreq module doesn't work and with the p4-clockmod module it just became very sluggish and battery time didn't increase at all.
A learning experience is one of those things that say, "You know that thing you just did? Don't do that." - Douglas Adams

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #20 on: October 15, 2009, 03:19:50 AM »
On my Eeepc900 with the celeron processor loading the acpi-cpufreq module doesn't work and with the p4-clockmod module it just became very sluggish and battery time didn't increase at all.

I do not have Eeepc900 in hand but according to different articles its BIOS supports scaling via ACPI so it is expected to work. I see Kernel patches to support Eeepc900 back in November 2008. Do not know wether the current TC kernel supports it or not.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline 4-stroke

  • Jr. Member
  • **
  • Posts: 72
Re: Cpu frequency scaling basics
« Reply #21 on: October 15, 2009, 03:37:11 AM »
On my Eeepc900 with the celeron processor loading the acpi-cpufreq module doesn't work and with the p4-clockmod module it just became very sluggish and battery time didn't increase at all.

I do not have Eeepc900 in hand but according to different articles its BIOS supports scaling via ACPI so it is expected to work. I see Kernel patches to support Eeepc900 back in November 2008. Do not know wether the current TC kernel supports it or not.

I found the answer in this thread:

http://forum.eeeuser.com/viewtopic.php?id=74209

PS. I've read your pm. I'll try it out when I get home. Thanks! ;D
A learning experience is one of those things that say, "You know that thing you just did? Don't do that." - Douglas Adams

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #22 on: October 15, 2009, 03:41:56 AM »
Thanks for the info. Seems that the key is EeePC ACPI Utilities at:

http://sourceforge.net/projects/eeepc-acpi-util/

which is not available (yet) in the TC repo. Strange enough there is an MS .exe binary in the bin folder while it looks a LINUX package.  ???
« Last Edit: October 15, 2009, 03:45:35 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: Cpu frequency scaling basics
« Reply #23 on: October 15, 2009, 04:34:08 AM »
You can achieve a lot by playing with the conf file in the cpufreq extension

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: Cpu frequency scaling basics
« Reply #24 on: March 16, 2010, 06:15:17 PM »
Code: [Select]
root@box:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Sempron(tm)   2500+
stepping        : 1
cpu MHz         : 1748.190
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up
bogomips        : 3497.06
clflush size    : 32
power management: ts
root@box:~# modprobe powernow-k7
modprobe: failed to load module powernow-k7: No such device
root@box:~# modprobe acpi-cpufreq
modprobe: failed to load module acpi-cpufreq: No such device
root@box:~#

dCore user

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #25 on: March 16, 2010, 06:31:44 PM »
Same result here on TC 2.10rc2 with Sempron 2800+ :(
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline 4-stroke

  • Jr. Member
  • **
  • Posts: 72
Re: Cpu frequency scaling basics
« Reply #26 on: March 17, 2010, 12:47:10 AM »
I have a Sempron 2800+ and I'm using powernow-k8 right now...
A learning experience is one of those things that say, "You know that thing you just did? Don't do that." - Douglas Adams

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #27 on: March 17, 2010, 02:15:35 AM »
I have a Sempron 2800+ and I'm using powernow-k8 right now...

On which TC version?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline 4-stroke

  • Jr. Member
  • **
  • Posts: 72
Re: Cpu frequency scaling basics
« Reply #28 on: March 17, 2010, 02:39:03 AM »
I have a Sempron 2800+ and I'm using powernow-k8 right now...

On which TC version?

2.10rc2
A learning experience is one of those things that say, "You know that thing you just did? Don't do that." - Douglas Adams

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Cpu frequency scaling basics
« Reply #29 on: March 17, 2010, 03:41:46 AM »
Would you check content of /proc/acpi/processor/CPU0 on you machine? Here it shows that power management is not supported by ACPI at all:

Quote
info:

processor id:            0
acpi id:                 0
bus mastering control:   no
power management:        no
throttling control:      no
limit interface:         no

limit:

<not supported>

power:

active state:            C0
max_cstate:              C8
bus master activity:     00000000
maximum allowed latency: 2000000000 usec
states:

throttling

<not supported>

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."