CPU Scaling too aggressive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Jaunty |
Fix Released
|
Low
|
Unassigned |
Bug Description
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/
devices/
devices/
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.
Changed in linux: | |
status: | Confirmed → Triaged |
Changed in linux: | |
status: | Incomplete → Triaged |
Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in recently. We were wondering if this is still and issue for you? Thanks in advance.