I pooled together information on cpu governors and I/O schedulers from several sources. If anyone has any additional information to add, feel free to chime in
. Credit goes to Knzo, Pikachu01, HipKat, and Droidphile for this compilation. This will continue to expand as I come across more information.
Apps are the probably the most popular methods for controlling these settings. I won't list them all, but here are the most common:
Voltage Control - I find this to be the best option; its "set at boot" method is faster and more reliable (init.d script created by the app). Doesn't have a widget that I find useful, but has everything SetCPU has and then some (I/O scheduler, GPU control, charging current, etc.)
SetCPU - limited to governors, voltages, sampling rate, etc. but has a very useful widget. I've experienced issues before with it successfully setting values at boot.
*Interested in jumping to a particular governor/scheduler/term? Press Ctrl + F and enter the term.
Post 1 - Governors
Post 2 - I/O Schedulers
Governors
Apps are the probably the most popular methods for controlling these settings. I won't list them all, but here are the most common:
Voltage Control - I find this to be the best option; its "set at boot" method is faster and more reliable (init.d script created by the app). Doesn't have a widget that I find useful, but has everything SetCPU has and then some (I/O scheduler, GPU control, charging current, etc.)
SetCPU - limited to governors, voltages, sampling rate, etc. but has a very useful widget. I've experienced issues before with it successfully setting values at boot.
*Interested in jumping to a particular governor/scheduler/term? Press Ctrl + F and enter the term.
Post 1 - Governors
Post 2 - I/O Schedulers
Governors
. . .
So, what's a governor?
There are many governors around, some for single-cores, some for dual-cores which I won't even refer to (jRCU). In stock you can find 5 governors, in Quasar kernel you can find much more. Most android and xda users don't even know half of governors I'll list as there is no android kernel out there with more governors than Quasar, only one has the same amount and this is a kernel made by my friend and fellow portuguese franciscofranco.Code:Consider a CPU, the processor of Optimus Black. Well, this CPU operates at different frequencies (on stock: 300, 600, 800 and 1000 Mhz) and we usually say it's a 1 Ghz (1000 Mhz) processor because that's the max frequency it can go 100% stable. Now, a governor is a CPUFreq driver. Like the name suggests, it is what decides when to be on full speed at max frequency or when to be at min or mid and how fast should it reach the max/min, should it be almost insta and provide a good smoothness overall? Should it take longer and go 200 Mhz at a time and preserve battery? This and more is what a governor is.
Listing of knzo-known governors:
- Ondemand *&
- Powersave *@
- Userspace *
- Conservative *
- Performance *
- Interactive +
- InteractiveX +
- Smartass +
- Smoothass +
- BrazilianWax +
- SavagedZen +
- Minmax +&
- Scary +
Legend: & - default | @ - disabled by default | * - exists in stock kernel | + - added in Quasar kernel
And now the official summary for each and brief comment by myself:
Ondemand:
Ondemand is the default choice due to its balanced settings which offers a good compromise between battery and performance. However, it has no suspend profiles and falls a bit short on performance in smartphones.Code:/* * drivers/cpufreq/cpufreq_ondemand.c * * Copyright (C) 2001 Russell King * (C) 2003 Venkatesh Pallipadi <[email protected]>. * Jun Nakajima <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */
Powersave:
Powersave sets the max frequency at the same clock as the min frequency. Impossible for daily usage for obvious reasons. Used usually with SetCPU screen-off profiles in combo with Ondemand.Code:/* * linux/drivers/cpufreq/cpufreq_powersave.c * * Copyright (C) 2002 - 2003 Dominik Brodowski <[email protected]> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */
Userspace:
Userspace lets you manually set the frequencies. To be completely honest, I've never used it and I've never heard of anyone who uses it. I'm completely off on how it fares or if it even works or any of its kinks.Code:/* * linux/drivers/cpufreq/cpufreq_userspace.c * * Copyright (C) 2001 Russell King * (C) 2002 - 2004 Dominik Brodowski <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */
Conservative:
Conservative is a slower Ondemand when it comes to ramping. For example, when you turn on the phone and start interacting with it, Ondemand will increase frequency until it reaches max at x speed. Conservative will do the same at x/2. Faster the ramping the more battery it consumes so conservative while a worse governor for performance it's also a good one for battery.Code:/* * drivers/cpufreq/cpufreq_conservative.c * * Copyright (C) 2001 Russell King * (C) 2003 Venkatesh Pallipadi <[email protected]>. * Jun Nakajima <[email protected]> * (C) 2009 Alexander Clouter <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */
Performance:
If Powersave governor is Yin, this one is Yang. It sets the min frequency the same as max frequency so the phone is always at max power. This is usually used with SetCPU profiles for when charging or plugged to computer. For obvious reasons can't be used in daily usage.Code:/* * linux/drivers/cpufreq/cpufreq_performance.c * * Copyright (C) 2002 - 2003 Dominik Brodowski <[email protected]> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */
Interactive:
While Conservative is a slower Ondemand, Interactive is a faster one. Ramping will be slightly faster so interaction will seem more snappy with battery comsumption just increasing a tiny bit. This has been the most popular governor for the past year.Code:/* * drivers/cpufreq/cpufreq_interactive.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Mike Chan ([email protected]) * */
InteractiveX:
As you can see in the summary, this is Interactive with some modifications by imoseyon. Now instead of using the dirty SetCPU profiles method of locking the frequency to minimum when phone is asleep, the own governor will do that which is a cleaner method and with a better ramping management when coming out of sleep. Basically, it has Interactive's performance with better battery.Code:/* * drivers/cpufreq/cpufreq_interactive.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Mike Chan ([email protected]) - modified for suspend/wake by imoseyon * */
Smartass:
This one has been increasingly popular and it's becoming the favorite one for Q3-4 2011. Smartass is based on Interactive but with some modifications, as well as built-in profiles. Recently, Erasmux released this v2 which by what people are saying it's very good. I suggest you go to this link for more informations. It's probably Quasar's best governor at the moment, along with Minmax.Code:/* * drivers/cpufreq/cpufreq_smartass2.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Erasmux * * Based on the interactive governor By Mike Chan ([email protected]) * which was adaptated to 2.6.29 kernel by Nadlabak ([email protected]) * * SMP support based on mod by faux123 * * requires to add * EXPORT_SYMBOL_GPL(nr_running); * at the end of kernel/sched.c * */
Smoothass:
One more jewel from Erasmux. As far as I know this is a Smartass v1 tuned for a more aggressive ramping, which means, more performance and snappiness, less battery.Code:/* * drivers/cpufreq/cpufreq_smoothass.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Erasmux * * Based on the interactive governor By Mike Chan ([email protected]) * which was adaptated to 2.6.29 kernel by Nadlabak ([email protected]) * * requires to add * EXPORT_SYMBOL_GPL(nr_running); * at the end of kernel/sched.c * */
BrazilianWax:
Someone correct me if I'm wrong but this is basically the same as Smoothass.Code:/* * drivers/cpufreq/cpufreq_brazilianwax.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Erasmux * * Based on the interactive governor By Mike Chan ([email protected]) * which was adaptated to 2.6.29 kernel by Nadlabak ([email protected]) * * requires to add * EXPORT_SYMBOL_GPL(nr_running); * at the end of kernel/sched.c * */
SavagedZen:
Another Smartass-based kernel with many modifications aiming to attain both better battery and performance. And it succeeds in my opinion. I've used it in past devices, it's a very good overall governor, a balanced option.Code:/* * drivers/cpufreq/cpufreq_savagedzen.c * * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Author: Joshua Seidel * Based on the smartass governor by Erasmux * * Based on the interactive governor By Mike Chan ([email protected]) * which was adaptated to 2.6.29 kernel by Nadlabak ([email protected]) * --Modifications by arescode-- * adapted to stock (1 GHz) frequency by zacharias.maladroit * * requires to add * EXPORT_SYMBOL_GPL(nr_running); * at the end of kernel/sched.c * */
Minmax:
This governor was a very pleasant surprise. Although an adaptation of Conservative governor it has probably the best performance of them all. Might fall shorter on battery than Smartass v2 but I owe it my best experiences in terms of snappiness so far, reason why I selected it as default governor for Nova. My personal favorite until I can draw a conclusion from using Smartass v2.Code:/* * drivers/cpufreq/cpufreq_minmax.c * * Copyright (C) 2001 Russell King * (C) 2003 Venkatesh Pallipadi <[email protected]>. * Jun Nakajima <[email protected]> * (C) 2004 Alexander Clouter <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This governor is an adapatation of the conservative governor. * See the Documentation/cpu-freq/governors.txt for more information. * * Adapatation from conservative by Erasmux. */
Scary:
This is just a weird governor. It's based on Conservative which has a slower ramping than Ondemand but then again it has Smartass elements which is a governor with one the fastest rampings. I've heard some people like it but alas I never tried it myself.Code:/* Scary governor based off of conservatives source with some of smartasses features For devs - If you're going to port this driver to other devices, make sure to edit the default sleep frequencies & prev frequencies or else you might be going outside your devices hardware limits. */
. . .
lazy:
Basically and ondemand with an additional parameter min_time_state which specifies the minimum time cpu stays on a frequency before scaling up/down. Idea here is to eliminate instabilities caused by fast frequency switching of ondemand. lazy governor polls more often than ondemand, but changes frequency only after completing min_time_state on a step. Lazy also has a screenoff_maxfreq parameter which can be configured to specifiy max frequency while screen is off.
lulzactive:
Based on interactive & smartass governors, this governor tends to be the new favorite for many of us. When workload is greater than or equal to 60%, the governor scales up cpu to next higher step. When workload is less than 60%, governor scales down cpu to next lower step. On screen off, frequency is locked to global scaling minimum frequency.
lagfree:
Similar to ondemand. Difference is optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree doesn't skip frequencies while scaling up or down.
smartassV2:
Modified smartass and one of the favorite governor for many a people. This governor scales down cpu very fast while screen is off and scales up to 500 mhz quickly when screen is on. There's no upper limit for frequency while screen is off. The governor aim for an "ideal frequency", and ramp up more aggressively towards this freq and less aggressive after. It uses different ideal frequencies for screen on and screen off, namely awake_ideal_freq and sleep_ideal_freq. Thus ensuring a balance between performance and battery.
ondemandx:
Basically an ondemand with suspend/wake profile. This governor is a battery friendly ondemand. When screen is off, max frequency is 500 mhz.
. . .
. . .
intellidemand:
Intellidemand aka Intelligent Ondemand from Faux is yet another governor that's based on ondemand. Unlike what some users believe, this governor is not the replacement for OC Daemon (Having different governors for sleep and awake). The original intellidemand behaves differently according to GPU usage. When GPU is really busy (gaming, maps, benchmarking, etc) intellidemand behaves like ondemand. When GPU is 'idling' (rather moderately busy), intellidemand limits max frequency to a step depending on frequencies available in your device/kernel for saving battery. This is called browsing mode. We can see some 'traces' of interactive governor here. Frequency scale-up decision is made based on idling time of cpu. Lower idling time (<20%) causes cpu to scale-up from current frequency. Frequency scale-down happens at steps=5% of current frequency. (This parameter is tunable only in conservative, among the popular governors)
To sum up, this is an intelligent ondemand that enters browsing mode to limit max frequency when GPU is idling, and (exits browsing mode) behaves like ondemand when GPU is not busy; to deliver performance for gaming and such. Intellidemand does not jump to highest frequency when screen is off.
lionheart:
Lionheart is a tweaked conservative governor from Knzo. You can simply modify conservative to experience lionheart. Set low up-threshold (60 or something) and lowest possible sampling rate on conservative. Lionheart's motto is extreme responsiveness and performance, at the cost of battery. When it comes to smoothness (not considering battery drain), a tuned conservative delivers more as compared to a tuned ondemand. This could be the reason for lionheart's 'birth'.
. . .
Information on the Pegasusq governorHotplug Governor:
The “hotplug” governor scales CPU frequency based on load, similar to “ondemand”. It scales up to the highest frequency when “up_threshold” is crossed and scales down one frequency at a time when “down_threshold” is crossed. Unlike those governors, target frequencies are determined by directly accessing the CPUfreq frequency table, instead of taking some percentage of maximum available frequency.
LulzactiveQ
I was decided to optimize Lulzactive governor by including the dec_cpu_load parameter.
----
I was going to put it because if the inc_cpu_load is setted at a high value (example: 90%) and the pump_down_steps is also setted high (2 or 3 steps down if load < inc_cpu_load) it would happen a problem:
Suppose the current load is between 80 and 89% all the sampling rate and the pum_down_steps is 2 or 3. Do you think is a good idea to go down 2/3 steps in the load at that high?
This is not a theorical issue, i really felt lag when playing some simple games and my conclusion was that situation was happening in that moment.
Thats why i created dec_cpu_load, in this way we can tell the governor exactly when go down pump_down_steps.
----
I also fixed a little bug as well that the up_sample_time and down_sample_time wasnt been respected (the governor was scaling up and down as soon as the load criteria was matched).
-----
And i added as gokhan requested, the hotplug parameters from pegasusq. So now we have two governors with hotplug queue logic.
To the hotplug part i had to create another sample rate. The name is hotplug_sample_rate. I created that to make the hotplug part completely independent from scale up / down frequencies part. In fact, they are running in different threads.
-----
That's it. I also putted some logs that can be enabled / disabled by the dvfs_debug parameter.
If do you think something was wrong, or a problem apperead please enable this parameter for a while and execute this command in terminal emulator or adb:
dmesg > /sdcard/lulzactiveq.log.txt
----------------------
This is only a battery profile suggestion for the 16 steps. Please explore it!!!!!!
-- Parâmetros Lulzactive
echo "90" > /sys/devices/system/cpu/cpufreq/lulzactiveq/inc_cpu_load
echo "40" > /sys/devices/system/cpu/cpufreq/lulzactiveq/dec_cpu_load
echo "1" > /sys/devices/system/cpu/cpufreq/lulzactiveq/pump_up_step
echo "2" > /sys/devices/system/cpu/cpufreq/lulzactiveq/pump_down_step
echo "50000" > /sys/devices/system/cpu/cpufreq/lulzactiveq/up_sample_time
echo "25000" > /sys/devices/system/cpu/cpufreq/lulzactiveq/down_sample_time
echo "14" > /sys/devices/system/cpu/cpufreq/lulzactiveq/screen_off_min_step
-- Lulzactive - Hotplug Queue parameters
echo "50000" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_sample_rate
echo "13" > /sys/devices/system/cpu/cpufreq/lulzactiveq/cpu_up_rate
echo "13" > /sys/devices/system/cpu/cpufreq/lulzactiveq/cpu_down_rate
echo "600000" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_freq_1_1
echo "400000" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_freq_2_0
echo "350" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_rq_1_1
echo "300" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_rq_2_0
echo "0" > /sys/devices/system/cpu/cpufreq/lulzactiveq/hotplug_lock
-- debug on/off
echo "0" > /sys/devices/system/cpu/cpufreq/lulzactiveq/debug_mode
Last edited: