Public bug reported:

CPU frequency scaling seems to be overly aggressive.  On my 1.9GHz
Athlon Brisbane X2 65nm machine, I've got quite a bit of power...
playing an MP3 puts me at 22% for one CPU core (sampled over 3 second)
and pushes me immediately from 1GHz up to 1.9GHz.

The default sampling rate (1.24 seconds) is fine; I sampled over 1
second and got 36% CPU usage (out of 200%; I have 2 cores), 684MHz.
1.0GHz mode should handle this fine but the CPU scales up.

The default threshold turned out to be 31% (of one CPU/core, not of the
whole set; this makes sense because not all CPU-demanding apps are
multi-threaded).  As soon as I hit 31% of the CURRENTLY SCALED CPU over
1.24 seconds, I got thrown into the next CPU frequency (1.9GHz; very
coarse grained here).  Note this is relatively measured from the current
scaling mode; so my 36% CPU usage was measured as 68.4% of a 1.0GHz CPU.

To correct this, I set the up_threshold to 95% and installed sysfsutils
to make the changes persist.  My /etc/sysfs.conf looks as below:

devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold = 95
devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate = 620000

The first line is default; the second line is relevant change; the third
is a reduced sampling rate I added to improve frequency scaling response
under load, which also causes small, momentary spikes to throw the
threshold up higher.

I recommend implementing a higher up_threshold, perhaps 70-80%.
Reducing the sampling rate may also prove interesting; I am having good
results with 95% threshold and 620mS sampling rate.  My CPU stays in
1.0GHz mode until I need out; it switches out quickly; and under load
from something as simple as Nexuiz it stays in 1.9GHz mode to meet CPU
demands.  Anything under 50% CPU load sampled every half second seems to
keep me in low-frequency mode, excellent for laptops.

** Affects: Ubuntu
     Importance: Undecided
         Status: Unconfirmed

-- 
CPU Scaling too aggressive
https://bugs.launchpad.net/bugs/107545
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to