9

After playing with GRUB profiling and installing preload, default scaling governor suddenly becomes 'performance' not 'ondemand'. I tried to enable /etc/init.d/ondemand service, but nothing changes - after reboot or resume, governor is always 'performance'. Do anybody knows what happened and how to revert old behaviour.

I'm using HP 6710s laptop.

1
  • Uninstall cpufreqd. Use only cpufreq-utils.
    – user247165
    Feb 11, 2014 at 18:45

3 Answers 3

13

You can Manually set the governor by running the cpufreq-set command (as root).

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.

sudo cpufreq-set -c 0 -g ondemand

To install cpufreq-set:

sudo aptitude install cpufrequtils

cpufrequtils includes a daemon which allows users to set the desired scaling, governor and min/max clock speeds for all processor cores at boot-time. Before starting the daemon, edit /etc/default/cpufrequtils as root, selecting the desired governor and setting the min/max speed for your CPU(s), for example:

/etc/conf.d/cpufreq
#configuration for cpufreq control
# valid governors:
#  ondemand, performance, powersave,
#  conservative, userspace
governor="ondemand"
# valid suffixes: Hz, kHz (default), MHz, GHz
min_freq="1GHz"
max_freq="2GHz"

Source: archlinux.org

10
  • Thanks, this works fine. Probably when I have some time, I will try to find why this happened at all.
    – user65404
    Jun 11, 2012 at 6:57
  • 7
    It's /etc/default/cpufrequtils on Ubuntu, not /etc/conf.d/cpufreq. And the variables (as seen in /etc/init.d/cpufrequtils) are MAX_SPEED, MIN_SPEED and GOVERNOR.
    – elmicha
    Jun 19, 2012 at 6:08
  • @elmicha I'll verify, and edit as needed. Thanks :)
    – Mitch
    Jun 19, 2012 at 6:26
  • 1
    sudo cpufreq-set -c 0 -g ondemand will just apply to the frequency of the first CPU or core. So, for example, on a dual core system, you have to run sudo cpufreq-set -c 1 -g ondemand next, so it takes effect for both cores. Jul 9, 2012 at 2:09
  • Do all your CPUs at once: for cpu in $(seq 0 $(($(nproc) -1))) ; do echo sudo cpufreq-set -c $cpu -g ondemand ; done Dec 8, 2014 at 10:50
1

You can use following command to change governor:

cpufreq-selector -g ondemand

With this command, you don't need root privileges to change governor. Just add this command to Startup Applications... to change governor on login.

2
  • 1
    Problem was in Jupiter which changes governor at each restart/resume even if program isn't running.
    – user65404
    Jul 10, 2012 at 9:04
  • You saved my day, I edited that command and use it with Cuttlefish to dim light and switch the governor on change of power ;) Man youre great!
    – Zbunjeni
    Nov 26, 2014 at 23:59
0

Under Xubuntu, you also need to disable ondemand task by command:

sudo update-rc.d ondemand disable

the system boot cpu as GOVERNOR="performance" mentioned above

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .