You are not logged in.

#1 2009-01-29 05:00:18

pgiddy
Member
Registered: 2009-01-29
Posts: 8

cpufreq behaving somewhat erratically

Ever since the kernel update from about 2-3 weeks ago, I've been having poor performance through cpufreq.  With some operations that are very CPU intensive, the speed won't budge above 800mhz (it's lowest setting).  For example, with Youtube videos, they seem to slow down because the CPU won't switch to full speed.  It's getting pretty annoying, because I have to type:

sudo cpufreq-set -g performance

...every time I want more speed now.  After I'm done with maximum speed, I have to switch back down to:

sudo cpufreq-set -g ondemand

Before this kernel update (can't for sure say which one as there have been more updates since then), things were working beautifully.  The CPU would adjust at a moment's notice up to 1.7ghz (max speed) and then back down again after it was done.  It very rarely goes up to max speed anymore.  Seems like when Shaman is tidying up, the CPU likes to turn up but other than that...

I'm running this kernel:

$ uname -a
Linux arch 2.6.28-ARCH #1 SMP PREEMPT Sun Jan 25 09:43:53 UTC 2009 x86_64 AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53 AuthenticAMD GNU/Linux

I also haven't changed anything in BIOS and there doesn't seem to be much to change anyway, CPU-wise.  I'm loading the same modules in /etc/rc.conf as well (powernow-k8 cpufreq_ondemand).

Anyone else having similar problems?

Offline

#2 2009-01-29 06:35:11

evr
Arch Linux f@h Team Member
Registered: 2009-01-23
Posts: 554

Re: cpufreq behaving somewhat erratically

i've actually been noticing the same problem since the last kernel upgrade as well.  I have the same kernel as you with a core2duo processor.

Offline

#3 2009-02-06 14:27:03

phalkone
Member
Registered: 2009-02-01
Posts: 2

Re: cpufreq behaving somewhat erratically

I've only recently switched to Arch from Fedora. I really like it and would not want to switch back. I am however having the same problem as the persons above me. I'm sure cpu ondemand scaling was working under Fedora. In Arch however when I select the ondemand governer it always stays at the lowest frequency (800 MHz). I've tried playing flash videos simultaneously with opening GIMP, Inkscape, Eclipse and on top of this encoding a video in AviDemux. The cpu however always stays at the lowest frequency. Some information about my system:

$ uname -a
Linux dellxps 2.6.28-ARCH #1 SMP PREEMPT Sun Jan 25 09:43:53 UTC 2009 x86_64 Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz GenuineIntel GNU/Linux
$ lsmod | grep cpu
cpufreq_powersave       3840  0 
cpufreq_ondemand       10512  1 
acpi_cpufreq           10896  1 
freq_table              6272  2 cpufreq_ondemand,acpi_cpufreq
processor              46776  4 thermal,acpi_cpufreq

I enable cpu scaling at boot with the /etc/rc.d/cpufreq (added to my list of daemons) and with the following settings:

$ cat /etc/conf.d/cpufreq
governor="ondemand"

min_freq="0.8GHz"
max_freq="2.2GHz"

Offline

#4 2009-02-06 16:03:18

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: cpufreq behaving somewhat erratically

Why don't you comment the min_freq and max_freq and let the driver sort it out?
I'm using the latest kernel (on an AMD machine) and scaling works fine.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2009-02-06 21:59:21

phalkone
Member
Registered: 2009-02-01
Posts: 2

Re: cpufreq behaving somewhat erratically

R00KIE wrote:

Why don't you comment the min_freq and max_freq and let the driver sort it out?
I'm using the latest kernel (on an AMD machine) and scaling works fine.

I commented the min and max frequency out and it works now. The strange thing is that I only defined a min and max freq in an effort to fix the problem (before these were always commented out). I'm really wondering why it works now and wouldn't be suprised if this problem popped up again.

Offline

#6 2009-02-06 22:49:32

pgiddy
Member
Registered: 2009-01-29
Posts: 8

Re: cpufreq behaving somewhat erratically

That section was already commented out for me but I did do a check with:

stress -c 1

...and I noticed it brought the CPU immediately to full speed.  Once I typed in:

killall stress

...the CPU was immediately brought down to low speed.

So it seems like when the CPU is getting very stressed is the trigger to go up to full speed, but it's the area that's in-between that the CPU is so conservative with.  I keep wondering if cpufreq is sending the "conservative" command as opposed to the "ondemand" command.  Youtube videos and flash games are still a bit choppy at times when they could have been smooth with a cranked-up CPU.

Offline

#7 2009-02-08 01:54:46

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: cpufreq behaving somewhat erratically

It depends on the cpu load, from what I've seen if the load is lower than 80% then it doesn't change to the next frequency available .... I have no idea what the criteria is to change down but this behavior seems ok to me.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2009-02-08 05:16:49

pgiddy
Member
Registered: 2009-01-29
Posts: 8

Re: cpufreq behaving somewhat erratically

The kernel was just updated again, so we'll have to see how it fares.  Some processes like video just need to be smooth to be more watchable. 

Is there possibly a way you could tell the CPU to go to full speed if a certain app (Flash, VLC, MPlayer, etc.) is running?  This being Linux, I'm sure there is, but would it be very practical?

Offline

#9 2009-02-23 02:47:51

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

I have the same problem, I am in an AMD machine, cpufreq doesn't work as well as before. After installing this new arch, there are many small problems, this being one of them, is quite annoying. The process keey staying at the lowest level leaving flash playing choppy!

I will try to comment out min/max in /etc/conf.d/cpufreq to see if it work when I get back home.

Offline

#10 2009-02-23 03:23:58

pgiddy
Member
Registered: 2009-01-29
Posts: 8

Re: cpufreq behaving somewhat erratically

I think I've honed-in on the problem and it keeps pointing to flash instances not prodding the CPU into performance mode.  Flash video is still annoyingly choppy.

Offline

#11 2009-02-23 05:27:23

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

commont out the min/max in /etc/conf.d/cpufreq doesn't help, the cpu is still at 1000 or 1800 leaving the flash playing very choppy. After I set the government to performance it hit to 2700 and vidoe become smooth. Right after I switch it back to ondemand, flash become choppy again.

sigh..... sad

Offline

#12 2009-02-23 06:23:50

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: cpufreq behaving somewhat erratically

I recommend using an application like KPowersave. It manages the CPU governors and it's doing it really good for me smile Not sure what the equivalent for GNOME is.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#13 2009-02-23 14:40:35

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: cpufreq behaving somewhat erratically

I'm not sure but I guess KPowersave might be just a frontend for cpufreq-{set,info}.
When I used gnome, the applet that allowed to check the speed of the cpu didn't allow me to change it, maybe that is different now.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2009-02-23 15:37:12

mihi
Member
Registered: 2009-01-27
Posts: 10

Re: cpufreq behaving somewhat erratically

Hi, I also had some problems with cpufreq. Three observations:

- Give cpufreq-set the CPU/Core you want to change: cpufreq-set -c 0 -g performance (for CPU/Core 0).
- I'm switching to performance on AC and to "conservative" on Battery - I don't know if that's better, subjectively it is.
- My laptop has a key for slowing down (LG P310). Somehow it gets activated on boot and reduces the max. speed to 800MHz. I didn't fully resolve that by now. cpufreq-info shows the normal frequencies (800-2530) but in the text below that it says "...the governor can choose between 800 and 800...". Currently I deactivate it by hand when necessary.

AFAIK - you can only change the speed of the CPU with applets using the "userspace" governor - at least that's what I was experiencing.

HTH.

Last edited by mihi (2009-02-23 15:42:04)

Offline

#15 2009-02-23 16:48:44

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: cpufreq behaving somewhat erratically

In my case I'm not specifying which core to set the governor so both get affected (Turion X2) and things have been working as expected here. I've just tried and even if I select just one core to set the governor both get affected.

$ cpufreq-info
cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: powernow-k8
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 800 MHz - 2.20 GHz
  available frequency steps: 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 800 MHz
  available cpufreq governors: powersave, ondemand, performance
  current policy: frequency should be within 800 MHz and 2.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
analyzing CPU 1:
  driver: powernow-k8
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 800 MHz - 2.20 GHz
  available frequency steps: 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 800 MHz
  available cpufreq governors: powersave, ondemand, performance
  current policy: frequency should be within 800 MHz and 2.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
$ uname -a
Linux archlinux 2.6.28-ARCH #1 SMP PREEMPT Wed Feb 18 21:27:38 UTC 2009 i686 AMD Turion(tm) 64 X2 Mobile Technology TL-64 AuthenticAMD GNU/Linux
$ lsmod | grep cpu
cpufreq_powersave       3456  0 
cpufreq_ondemand        8972  1 
freq_table              5632  2 cpufreq_ondemand,powernow_k8
$ lsmod | grep power
cpufreq_powersave       3456  0 
powernow_k8            15364  1 
freq_table              5632  2 cpufreq_ondemand,powernow_k8
processor              41388  2 thermal,powernow_k8
$ cat /etc/conf.d/cpufreq 
#configuration for cpufreq control

# valid governors:
#  ondemand, performance, powersave,
#  conservative, userspace
governor="ondemand"

# valid suffixes: Hz, kHz (default), MHz, GHz, THz
#min_freq="800MHz"
#max_freq="1.6GHz"

I'm loading the modules: powernow-k8 cpufreq_ondemand and starting cpufreq (backgrounded) and all seems to work as it always has ...


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#16 2009-02-23 19:27:42

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

IF you play mplayers, cpufreq work as is should, meaning it stay low with one mplayer playing, but jump to full Ghz with 2 mplayer playing at the same time in my Arch.

But when it comes to playing flash, it will not go to high frequency even the flash in firefox is choppy, you have to set it to "performance" to play flash smoothly enough.

Offline

#17 2009-03-08 10:26:57

kiker99
Member
Registered: 2008-07-09
Posts: 10

Re: cpufreq behaving somewhat erratically

When will this be fixed? It's really annoying.

Offline

#18 2009-03-08 20:05:42

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

yes, I pray to God that someone come up to solve this problem
lol:D

Offline

#19 2009-03-14 15:24:28

jojo4u
Member
Registered: 2009-01-03
Posts: 4

Re: cpufreq behaving somewhat erratically

This problem has plagued me since I bought my eee-PC 1000H last autumn. And one can see it best if you see choppy flash videos on youtube.

See also: https://bugs.launchpad.net/ubuntu/+sour … bug/122993

Last edited by jojo4u (2009-03-14 15:26:58)

Offline

#20 2009-03-17 16:48:14

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

Ok, have anybody solved this prolbem yet?

cpufreq scaled well with other applications, but NOT well at all with flashplaying. It won't scale CPU up even if the flash is playing very choppy. Every time like this, I have to manually set it to performance, then the flash become very smooth. Did somebody know why flash playing DOES NOT trigger cpufreq to scale up?
hmm:/

Last edited by yingwuzhao (2009-03-17 16:48:52)

Offline

#21 2009-04-02 01:32:15

yingwuzhao
Member
Registered: 2009-01-13
Posts: 109

Re: cpufreq behaving somewhat erratically

any idea??

big_smile:D

Offline

#22 2009-04-06 18:01:21

Wilco
Member
Registered: 2008-11-09
Posts: 440

Re: cpufreq behaving somewhat erratically

Haha just found out how to fix this:

# echo 20 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

It seems the default threshold was increased from 80 to 95 which means CPU usage would have to be 95% on average before it scales to a higher frequency. This sets is very low, at 20%, but feel free to experiment with other values.

Last edited by Wilco (2009-04-06 19:05:26)

Offline

#23 2009-04-06 23:36:20

pgiddy
Member
Registered: 2009-01-29
Posts: 8

Re: cpufreq behaving somewhat erratically

Works for me!  Thanks for sharing.  Wonder who thought it was a better idea to switch from 80 to 95.  At 20%, my CPU is always cranked up, so I've switched it to 50% for now.

Anybody else still having issues?

Offline

#24 2009-04-09 03:17:53

pgiddy
Member
Registered: 2009-01-29
Posts: 8

Re: cpufreq behaving somewhat erratically

hmm, it doesn't stay that way after a reboot.  It reverts back to 95.  Anybody have a way to make it stick?

Last edited by pgiddy (2009-04-09 03:18:22)

Offline

#25 2009-04-09 05:43:58

jleach
Member
Registered: 2008-07-24
Posts: 27

Re: cpufreq behaving somewhat erratically

pgiddy wrote:

hmm, it doesn't stay that way after a reboot.  It reverts back to 95.  Anybody have a way to make it stick?

Add the command to your /etc/rc.local

Offline

Board footer

Powered by FluxBB