[ubuntu-studio-devel] CPU governor settings

Len Ovens len at ovenwerks.net
Sun Dec 4 16:47:04 UTC 2016


I have put some of this stuff on IRC, but for those who missed and to have 
responses I can remember in one place... I have moved it here.

I have added the ability to select either Performance or Powersave as the 
CPU governor to ubuntustudio-controls. This just works at this point.
Feel free to download and install or add this ppa:
https://launchpad.net/~ubuntustudio-dev/+archive/ubuntu/autobuild
to try it out. (I prefer to download the *.deb and dpkg -i it :)

The part I would like to do next is to have a second checkbox that turns 
on persistance so this setting will survive reboot. cpufrequtils would 
make this rather easy as it reads a file in /etc/defaults/ to see what 
governor it should use for this system. Unfortunately, there is a second 
init script, ondemand that waits for 60 seconds and forces the ondemand 
governor at that point undoing whatever cpufrequtils does  :P

So, my next thought is that we can leave cpufrequtils set to performance 
at boot. Then ubuntustudio-controls can run:
update-rc.d ondemand disable
To set the next boot to performance, and:
update-rc.d ondemand enable
to set the next boot to ondemand/powersave

This article:
http://www.phoronix.com/scan.php?page=article&item=linux-47-schedutil&num=1
Seems to suggest intel p-state governors may have problems (at least in 
4.7, we use 4.4).

Also, it seems that powersave != powersave.
At least on my machine, powersave does not do what the docs say (run at 
lowest available frequency). My 32 bit system does this, my 64bit system 
does not. So the ubuntu default of use ondemand if available or powersave 
otherwise makes sense. If ondemand is available, powersave is bad, but if 
ondemand is not available powersave is the only other possibility and does 
ramp up speed.

More research on power use with performance vs ondemand. It appears that 
on a system that has an effective idle state, performance uses less power 
because it enters idle state much faster than ondemand. See:
http://www.phoronix.com/scan.php?page=news_item&px=MTM3NDQ

Despite what:
https://wiki.archlinux.org/index.php/CPU_frequency_scaling
says, performance on my pstate machine does not "provide dynamic scaling" 
(thankfully). This will be something to watch though as the first article 
I pointed to seems to indicate kernal 4.7 has bad performance governor 
stats. This may be because I have "Boost" turned off in BIOS. Turning 
Boost on may cause speed changes to cope with heat.

I have also noticed that having one core at a different speed than the 
other cores actually generates more heat (more heat means more power 
used). That is setting the governor to userspace and manually setting all 
cores to full speed runs cooler than lowering the speed of one of those 
cores. So there will be some loss using ondemand but if the speed on that 
one core is low enough, that may make up for this.

So it appears that -settings can add cpufrequtils to /etc/default/ with a 
setting to performance. This will at least speed up boot speed.
-controls should be able to set performance or ondemand/powersave in the 
same way as /etc/init.d/ondemand does (try ondemand but fall back to 
powersave)

As I find time in the next few weeks I will do more work on -controls and 
-settings.

--
Len Ovens
www.ovenwerks.net




More information about the ubuntu-studio-devel mailing list