[GUIDE] Advanced Interactive Governor Tweaks; Buttery smooth and insane battery life! - Xiaomi Mi 4i

The Introduction
I'm about to tell you how to get buttery smooth, lag free performance with insanely good battery life, using an old school governor featured in practically every kernel... This tweak is applicable to every phone with any ROM or kernel--stock or custom--that provides the Interactive Governor.
Yeah, yeah... everyone promises good battery with great performance, but who actually delivers? Maybe it isn't as smooth as you want, or maybe it requires something your kernel or ROM don't support. Or maybe the battery life promises just aren't what you expected. There's always some awful compromise. Not here!
This isn't a guide to get 36 hour battery life... provided you never use your phone. That's deep sleep optimization, which is lovely and all, but what good is the phone if you can never use it?! And with the new Marshmallow Doze feature, this strategy is becoming a think of the past. What I'm talking about is 7-14 hour screen on, actual hands-on usage times! Without compromising anything, you can get 7-8 hour screen on usage with regular, no-compromise usage habits: daytime visible screen brightness, both radios on, sync on, network location on, all the regular usage features, the whole kit and kaboodle... all smooth as a baby's butt and snappy as a Slim Jim! (Up to 14+ hours if you can stand minimum brightness and WiFi-only with a custom ROM and other stuff turned off! And this is with stock voltages and full frequency range--you'll likely get even more if you choose to optimize those as well!)
However, it should be noted that this does not apply to gaming, heavy camera use, etc. Anything that is an automatic battery killer in and of itself. There's nothing that can be done about anything that forces the phone to utilize its maximum resources all the time. But you should know that by now. Further, this guide is about optimizing the CPU as much as possible. It does not cover things like eliminating wakelocks so your phone sleeps well, removing unnecessary and battery draining stock apps, keeping your screen brightness down*, and all that stuff that's been covered in other posts ad infinitum. Those optimizations are up to you.
*At least on the Mi4i, you shouldn't be turning your screen brightness above about 50%. It should be more than viewable in sunlight at that brightness, and keep in mind that the brightness power requirements increase exponentially, so a 100% bright LCD screen will use about 3.5-4.5x more power than a 60% bright screen. I don't see that fact brought up often, so I thought I'd mention it here.
After a bit of tweaking and experimenting, I developed some settings that provide absolutely incredible battery life, buttery smooth performance, and a lag free experience. And you don't need a fancy governor, or a custom kernel, custom clock rates, or even a Mi4i. This will work on any ROOTed phone with the Interactive governor!
The Nitty Gritty
Before I lay out all the settings so you can blindly enter them into your governor control, I should to explain some of the principals I employed to get the results I did. The primary thing to understand before I do is: little might you know, the settings in the Interactive governor can be tweaked on a clock range basis. That is to say, you can finely control how the governor responds at a variety of clock rates, thus better dictating how it should operate under various loads. This is integral to the configuration, because it means the difference between jumping from the slowest speed to the highest speed under load and sustaining lower clock speeds for tasks that don't really require higher clock speeds.
By default, the Interactive governor will jump from lowest speed to a "nominal" speed under load, and then scale up from that speed as load is sustained. That is lovely, but still too twitchy to provide serious efficiency and power savings. It spends most of its time at 2 or 3 clock speeds and barely hits other clock speeds that are ideal for other tasks or usage patterns.
Instead, what we want to do is configure it to handle different types of loads in different ways. A load suited for scrolling through a webpage is not the same as a load suited for downloading/processing streaming video is not the same as a load suited for snappy loading of an app is not the same as a load suited for high performance gaming. Every kind of load has different tolerances at which their minimal speed is indistinguishable from their maximal speed.
Nominal Clock Rates
Nominal clock rates are the minimum CPU clock rates that perform a given task smoothly and without stuttering or lag. To find the nominal clock rate for a given task, turn on only the first CPU using the Performance governor and turn them both down incrementally until you find the minimum clock rate that works best for what you're trying to do, without introducing hiccups. (If you have a CPU or kernel that hotplugs individual cores, multiply that clock speed by your number of cores.) Keep the 2nd CPU on the Powersave governor with the lowest frequency your kernel supports. (Or turn it off completely if hotplugging allows.)
(Note: If your device supports per-core hotplugging, you might be better off using the old guide to determine your nominal clock rates. The Mi4i and all current kernels only support hotplugging entire CPUs, so your results may vary if you use any other device.)
For example, on my Mi4i, scrolling (not loading, simply scrolling) through a large webpage smoothly will occur when the second CPU clock rates are no less than 460Mhz. (This is on mine without background tasks taking any CPU. Yours may be different depending on services running, the browser you use, your ROM, kernel, etc.) Thus, the nominal clock rate for scrolling a webpage on my Mi4i is 460Mhz.
To understand what's best under a variety of tasks, we have to identify two types of load profiles: nominal clock rates and efficient clock rates.
Efficient Clock Rates
Efficient clock rates are CPU clock rates that are unique in that they are the most optimal frequency given the range of voltage requirements. If you map out the frequency jump and the voltage requirement jump between each of the available clock rates, you will find that occasionally the voltage requirement will jump significantly without the frequency jumping proportionally to the previous differentials. For example, using stock voltages, the EvoLTE's msm8960 chipset clock/voltage ratios jump significantly higher from 702Mhz to 810Mhz than the ratios from 594Mhz to 702Mhz.
This section is INCOMPLETE! If you know the voltages, please post and I can update this guide to include the Mi4i's Efficient Clock Rates.
Clock Rate Biases
Using the information provided above, figure out both your nominal clock rates for the tasks you perform most often and your efficient clock rates depending on your kernel/custom voltage settings. For me, since I cannot determine the efficient clock rates, I use the nominal clock rates listed above. For the tasks I generally perform on my phone, my nominal clock rates are as follows:
Idle - 345Mhz
Page Scrolling - 533Mhz
Video -800Mhz
App Loading - 960Mhz
High Load Processing - 1612Mhz
(Note that you must calculate the values that are optimal for your phone for best battery and performance! Each phone is different because of the ROM, kernel, background tasks, etc!)
With this done, you will want to start the fine tuning phase! Correlate the efficient clock rates with their closest nominal clock rates, similar to below:
(This section of the guide is INCOMPLETE because I do not know the clock rate voltages for the Mi4i. If you know these, please post in the comments and I will update the guide!)
Idle - ???Mhz efficient / 345Mhz nominal
Page Scrolling - ???Mhz efficient / 533Mhz nominal
Video - ???Mhz efficient / 800Mhz nominal
App Loading - ???Mhz efficient / 960Mhz nominal
High Load - ???Mhz efficient / 1651Mhz nominal
Keep these handy, as they're going to be necessary for...
The Set Up
Now that we know what are the most efficient nominal clock rates we want to focus on and what the most optimal are for what we want to do, we will start low and scale up as necessary. It's always better to begin with underperforming and tweak the settings upward until we're satisfied with the performance of our target tasks.
In its default state, the Interactive governor has a hair trigger that will raise and lower the clock rates, which means it spends too much time at unnecessary clock speeds, wasting power, and scales down too quickly, leading to stuttering performance. We will take advantage of a seldom used feature of the Interactive governor. Specifically, that with which it determines when it is okay to scale up to each higher clock rate, on a frequency by frequency basis.
We have two primary goals: respond as quickly as possible to each load request for a lag free experience and exceed the desired clock rate for a given task as little as possible. To do this, we will instruct the Interactive governor to trigger certain clock rates in different ways depending on our expected load.
I won't explain all of the settings of the Interactive governor--there are plenty of summaries all around. (Go search now if you don't know what any of the settings for Interactive governor do. I'll wait here.) However, I will explain an incredibly powerful feature of the Interactive governor that is rarely included in those summaries: multiple frequency adjustments.
The above_highspeed_delay setting, for example, defines how long the governor should wait before escalating the clock rate beyond what's set in highspeed_freq. However, you can define multiple different delays that the governor should use for any specified frequency.
For example, we want the above_highspeed_delay as low as possible to get the CPU out of the idle state as quickly as possible when a significant load is applied. However, we don't want it to jump immediately to the fastest clock rate once it's gotten out of idle, as that may be overkill for the current task. Our target trigger (which you will later adjust to suit your system and usage profile), will begin at 20000μs. That means 20,000μs (or 20ms) after our idle max load has been reached, we want to assume idle has been broken and we want to perform an actual task. (We want this value as low as possible without false positives, because it is one of a few factors that determine how snappy and lag free the CPU's response is.)
But at this point we're not ready to take on a full processing load. We may just be briefly scrolling a webpage and don't need the full power of the CPU now that we've allowed it to break out of idle. So we need it to reach a particular frequency and then hold it there again until we're sure the load is justified before we allow it to push the frequency even higher. To do that, rather than just setting
above_highspeed_delay - 20000​
we will instead use the format "frequency:delay" to set
above_highspeed_delay - 20000 460000:60000 600000:20000​
"Waaaait... What does that do?!"
This tells the Interactive governor to hold out 20ms after our target load when it's at our highspeed_freq (which we're actually using as our idle frequency--not a burst frequency as originally intended), but then it tells the governor to hold for 60ms after it's reached 460Mhz. Once it has exceeded 460Mhz, it then has free reign to scale up without limitation. (This will be optimized with the target_loads setting in a minute. And if you don't know what I'm talking about when I say "highspeed_freq" then you didn't go search for the basic Interactive governor settings and read about it! Go do that before you read any further, because I will not explain the basics of this governor!)
These settings are among the most important, because they limit the phone's clock rates when you are not interacting with it. If it needs to do something in the background, chances are it does not need to run full throttle! Background and idle tasks should be limited to the lowest reasonable clock rate. Generally speaking, if you're just looking at your phone (to read something, for example), you want the phone to use as little CPU power as possible. This includes checking in with Google to report your location or fetching some pull data or... whatever. Things that you don't need performance for.
So now that we know how to specify different settings for different frequency ranges, let's finish it all up with...
What About Touchboost?
Touchboost is a nifty feature in a lot of kernels (including stock on Mi4i) that jumps up the frequency so that you experience minimal lag. However, with all the above settings, touchboost is usally detrimental to the efficiency of the device!
We generally want to keep the CPU on the lowest possible frequency as much as possible, and touchboost interferes with that. Further, because we've set up the maximal and minimal efficient clock rates, as well as burst processing from the 1st CPU core, we don't need touchboost!
If your kernel allows you to shut it off, try to do so and see if the responsiveness of your device is acceptable. On the Mi4i, touchboost adds no perceptual performance gain and only hurts efficiency and battery life. If your kernel doesn't allow you to turn off touchboost, try another one, like the excellent Sensei.
Your battery life will thank you!
The Setup
In the "CPU" section, turn off "Touchboost". (This is crucial!! YOU MUST TURN OFF TOUCHBOOST OR ELSE YOU WILL NOT SEE ANY BATTERY SAVINGS!!!) Make sure the "Max CPU Frequency" is set to the maximum possible value for each CPU. Make sure the "Min CPU Frequency" is set to the minimum possible value for each CPU. Under "CPU Boost", set "input boost milliseconds" to "0". Then set the following values for each CPU under "Governor options" for each CPU respectively:
CPU #1 (aka "Big", aka "has 4 cores", aka "maxes out at 1665Mhz")
target_loads - 1 960000:80 1113600:85 1344000:90
timer_slack - 80000
hispeed_freq - 1113600
timer_rate - 20000
above_hispeed_delay - 20000 1113600:50000
go_hispeed_load - 85
min_sample_time - 50000
CPU #2 (aka "little", aka "has 4 cores", aka "maxes out at 1113Mhz")
target_loads - 1 800000:80
timer_slack - 80000
hispeed_freq - 998400
timer_rate - 40000
above_hispeed_delay - 10000
go_hispeed_load - 90
min_sample_time - 40000
The Conclusion
I have achieved unprecedented performance, smoothness, snappiness, and battery life with the default settings I outlined above. However, your mileage may vary, as every phone, ROM, kernel, installed applications, etc are different. This is a very sensitive governor profile and must be tweaked to just meet the requirements of your system and your usage patterns!
If it is not optimally tuned, performance and battery life will suffer! If you're not seeing buttery smooth, snappy performance, you have not correctly tuned it for your system!! However, if you do have superb performance (and you tweaked the values conservatively and not in large steps), then you will also get the aforementioned battery life.
I will be happy to answer any questions, or provide any guidance I can. However:
You must otherwise optimize your phone first! This will not "fix" a poorly optimized system and will, in fact, reduce performance and battery life without further optimization and proper tweaking.
I will not answer questions about "what is a governor?" There are plenty of resources available already, so search for them.
I will not answer questions about "how can I tweak [some other] governor?" This is about the Interactive governor only.
I will not respond to "nuh uh! show proof!" posts. The fact that I spent 12 hours writing this up should be proof enough that I am satisfied with the results. You can take it or leave it; makes no difference to me. The default settings should work with any fully optimized Mi4i running any kernel, so just try them on your own. If you're not absolutely satisfied (and trust me, either it'll work out-of-the-box with flying colors and you'll know it works for your system, or it'll be an awful experience which means you must tweak it), then you haven't adequately adjusted the settings to suit your system.
Lemme know what you think, and good luck!
Thanks to @soniCron for the original thread here : http://forum.xda-developers.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557

Woah, Will try it soon. Thanks for the awesome thread and work.

The interactive governor from your Sensei kernel already had all these settings tuned.
I will come back in 24-48 hours with results.
One question that I have is: will something like Amplify (deals with wakelocks) interfere with this?

mandarin91 said:
The interactive governor from your Sensei kernel already had all these settings tuned.
I will come back in 24-48 hours with results.
One question that I have is: will something like Amplify (deals with wakelocks) interfere with this?
Click to expand...
Click to collapse
I've dealt with a few wakelocks in the kernel, Amplify won't disturb anything I guess.. Also this is just for future refs for users who are either on stock or any other kernel...

How exactly does this target load list work - why the loads are not progressive, but 85 - 90 - 80? set target to 90% load at 1.1ghz, but then we want 80% at 1.3ghz? Shouldn't the target loads only go up?
target_loads - 1 960000:85 1113600:90 1344000:80

are you sure that above_highspeed_delay for CPU#2 is correct?

danb1974 said:
How exactly does this target load list work - why the loads are not progressive, but 85 - 90 - 80? set target to 90% load at 1.1ghz, but then we want 80% at 1.3ghz? Shouldn't the target loads only go up?
target_loads - 1 960000:85 1113600:90 1344000:80
Click to expand...
Click to collapse
Exactly. And where are the lower frequencies?
The lower frequencies are left untouched. I've been testing this for some time now. Look at the screenshots.

mandarin91 said:
Exactly. And where are the lower frequencies?
The lower frequencies are left untouched. I've been testing this for some time now. Look at the screenshots.
Click to expand...
Click to collapse
bump (?)
Will we get an answer?

I've fixed the settings, target load will now go up rather than up-up-down... Also these settigs are a WIP, right now this is the optimal settings I have that will provide battery life and performance. I will update the settings each time an improvement is made.

Lower frequencies aren't doing much fr me but I'll try to include them into the formula...

haikalizz said:
Lower frequencies aren't doing much fr me but I'll try to include them into the formula...
Click to expand...
Click to collapse
I am talking about these:
Idle - 345Mhz
Page Scrolling - 533Mhz
Video -800Mhz
App Loading - 960Mhz
High Load Processing - 1612Mhz
Click to expand...
Click to collapse
If these "aren't doing much" then there will be only five frequencies: 200, 960, 1113, 1344, and 1651.
And most of the time is spent on 200 or 960. Won't the frequencies between 200 and 960 give better battery life?

How can an awesome thread like this die?

mandarin91 said:
I am talking about these:
If these "aren't doing much" then there will be only five frequencies: 200, 960, 1113, 1344, and 1651.
And most of the time is spent on 200 or 960. Won't the frequencies between 200 and 960 give better battery life?
Click to expand...
Click to collapse
no it doesnt quite work that way. not all lower frequencies will give better battery life. it also depends on the SOC in question and the nature of the SOC. I think hakalizz has mentioned previously of several optimized voltages and frequencies which we don't know for the snapdragon 615. let's use the 615 and some hypothetical values
200mhz - 650mv
400mhz - 650mv
you would have thought that 200mhz would give better battery savings but that isnt the case over here. even though the 400mhz would use more power (even though it is rated the same as 200mhz), technically you get battery savings because 400mhz gets the job done in well, twice the speed of the 200mhz. So you need to either figure out which of your frequencies are optimized in such a way that it can take advantage of the race to idle factor too.
for now i'm still on zzmoove but only to a point where i figure out how to optimize interactive for my own usage (with hotplugging etc)
just to further the point on this advance interactive tweaks - theory-wise and practicality-wise it is sound, you use the best frequencies(Bare minimum that you can stand) and you enjoy battery savings as well. the only issue I see is if you use your phoen differently from the OP. that's why haikalizz says you need to tweak and adjust it on your own

davtse said:
no it doesnt quite work that way. not all lower frequencies will give better battery life. it also depends on the SOC in question and the nature of the SOC. I think hakalizz has mentioned previously of several optimized voltages and frequencies which we don't know for the snapdragon 615. let's use the 615 and some hypothetical values
200mhz - 650mv
400mhz - 650mv
you would have thought that 200mhz would give better battery savings but that isnt the case over here. even though the 400mhz would use more power (even though it is rated the same as 200mhz), technically you get battery savings because 400mhz gets the job done in well, twice the speed of the 200mhz. So you need to either figure out which of your frequencies are optimized in such a way that it can take advantage of the race to idle factor too.
for now i'm still on zzmoove but only to a point where i figure out how to optimize interactive for my own usage (with hotplugging etc)
just to further the point on this advance interactive tweaks - theory-wise and practicality-wise it is sound, you use the best frequencies(Bare minimum that you can stand) and you enjoy battery savings as well. the only issue I see is if you use your phoen differently from the OP. that's why haikalizz says you need to tweak and adjust it on your own
Click to expand...
Click to collapse
Dude, haikalizz mentioned those frequencies in the post but never implemented them in the settings. That is what I'm saying.
Idle - 345Mhz
Page Scrolling - 533Mhz
Video -800Mhz
App Loading - 960Mhz
High Load Processing - 1612Mhz

mandarin91 said:
Dude, haikalizz mentioned those frequencies in the post but never implemented them in the settings. That is what I'm saying.
Idle - 345Mhz
Page Scrolling - 533Mhz
Video -800Mhz
App Loading - 960Mhz
High Load Processing - 1612Mhz
Click to expand...
Click to collapse
dude, i was responding to your question, should these freq inbetween give better battery life

You must otherwise optimize your phone first! This will not "fix" a poorly optimized system and will, in fact, reduce performance and battery life without further optimization and proper tweaking.
Please tell me how to optimize my phone ?

rmusa06 said:
You must otherwise optimize your phone first! This will not "fix" a poorly optimized system and will, in fact, reduce performance and battery life without further optimization and proper tweaking.
Please tell me how to optimize my phone ?
Click to expand...
Click to collapse
Debloat, amplify, things like that...

haikalizz said:
Debloat, amplify, things like that...
Click to expand...
Click to collapse
Thank you sir

What app are you using to implement the changes?

Well I got some nice results applying this technique and have overall 1/2 hours more sot using interactive gov. The only profile that works and follows the normal rules is the Ghostpepper profile. I have a moto x play with the same soc so it should work for the mi4i to. First you must calculate the max and min target loads before you can do something power efficient using this technique.
My advice is try to translate the nexus5x ghostpepper profile and replace your min and max target_loads with the ones in the original profile.
And why is this thread just copied and pasted from the original nexus5 thread and only replaced some words with "mi4i". You also forgot the most important part: calculating the min and max target_loads.

Related

[Discussion] Ways to improve UI response on Android

Given the recent hoopla in the blogosphere about how iOS places higher priority on User Interface actions than Android. I was wondering what ideas can be implemented in current Android or Linux kernels to get better UI response.
Overclocking or upgrading to a faster phone is the brute force way, a smarter way would be to give higher priority to user input instead of benchmark/multitasking score numbers. I think it makes sense to give the User input highest priority because in computation timeframes, user input is rare, and considering how important smoothness affects overall perception & enjoyment of a device, it's a good idea to allow other OS background tasks to take a backseat when the User wants to do something.
I'll start the discussion with two ideas I've implemented in a kernel recently that has shown improvements in UI response.
1. Switched to using SIO (Simple IO) scheduler (similar, but slightly lower benchmarks than Noop). Main difference is SIO prevents the system from hogging resources when large amounts of data needs to be read/written. It has a timeout so UI threads has a chance to run also.
2. Switched the touchscreen driver interrupt service request from using the general events workqueue (schedule_work()) to a dedicated workqueue (queue_work()). Touchscreen generated actions get to ride in the fast lane.
Any other ideas people have?
How bout some NSA IN THAT KERNEL
via Dan swagger
Usefull links, that clear things out:
https://plus.google.com/100838276097451809262/posts/VDkV9XaJRGS
https://plus.google.com/105051985738280261832/posts/XAZ4CeVP6DC
http://blog.crazybob.org/2011/12/truth-about-android-ios-ui-performance.html
the thing is i may be using a note but when using ICS with apps that are updated for ICS, i feel its smooth enough. the real difference is i think ios uses completely different method for scrolling i.e. the bounce function and slight delay in finger recognition. same with ios touch recognition, it just somehow is better no doubt.
btw when i was miui with bounce it definitely felt smoother but although it wasnt ios smooth.
Sent from my Galaxy Note using XDA App
The main difference between ios and android is the fact they use ram in two totally different ways. Ios handles ram in a manner to make the user interface smooth as possible all the time while android frees ram to make multitasking better. The problem that android has is changing the way android handles ram to make the interface smoother for the user. They wont be able to for a long time because they have to do a total overhaul on the whole dalvik cache type setup that android uses.
Sent from my Incredible 2 using Tapatalk
i recently started using supercharger v6 which messes around with the ram and how it should be allocated for desired operations. I don't know if it's relevant but do you think it makes a difference and which setting would get you a better scrolling experience?
I liked the supercharger when I used the Droid Eris but since I've upgraded I get more redraws than without it. I used the 768hp I think.
Sent from my Incredible 2 using Tapatalk
you could edit the ramdisk to set more of a priority to rosie.apk or whatever launcher you use...just a thought
That would be the same as locking home in memory.
Sent from my Incredible 2 using Tapatalk
shad0wboss said:
i recently started using supercharger v6 which messes around with the ram and how it should be allocated for desired operations. I don't know if it's relevant but do you think it makes a difference and which setting would get you a better scrolling experience?
Click to expand...
Click to collapse
There are a number of issues that contribute to a "sluggish experience". The supercharger v6 script mainly keeps more memory free so that switching to new apps cuts down on the garbage cleanup of older apps. One of the downsides I've noticed with more aggressive lowmemkiller settings is a lot of apps get killed in the background when they need to stay for when users want to multitask.
The hardware acceleration route has downsides too from what I've heard, it requires more RAM per app just to have it enabled.
One of the articles posted earlier has good insight. Mainly because a lot of apps share a general events queue, and developers should not have a lot of blocking code in there, but developers make mistakes. The tools available for Android to develop and tweak UI performance seems lacking at this point.
How about SIGSTOPping everything else when you touch?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to General
does it work with samsung i9000?
Supercharger?
Sent from my Sabotaged Droid Incredible 2.
I find that either turning off cpufreq (by using the Performance governor) or increasing the lower frequency makes things a bit more snappy. For most governors, there's a delay between CPU load and the frequency being increased. This delay is usually noticeable if the CPU load is due to me working with the interface. By increasing the min frequency to, say 800mhz on a Nexus S, this makes things a lot more snappy than the default setting of 200mhz.
Another thing that helps with the smoothness (at least for me, in ICS) is the setting that forces GPU acceleration for all apps. For example, apps these days (well twitter and Facebook) have that pull down to refresh widget from iOS. Without forcing GPU acceleration, the rotating arrow animation usually hitches quite a bit, but is smoothed out with this setting on. This setting can be found in the developer options in the settings.
Hope these help,
- chris
Turning up the min CPU can cause freezes on some peoples phone though and using the performance governor can drain the battery quick. The reason the CPU scales up the way it does before it gets to max frequency is to save battery.
Sent from my Sabotaged Droid Incredible 2.
System tuner pro has alot of tweaking options that on memory use
those that use launcher pro can find a memory usage setting in launcher pro to.
disconnecktie said:
Turning up the min CPU can cause freezes on some peoples phone though and using the performance governor can drain the battery quick. The reason the CPU scales up the way it does before it gets to max frequency is to save battery.
Sent from my Sabotaged Droid Incredible 2.
Click to expand...
Click to collapse
Agreed, but the whole point here was to help improve UI responsiveness. Without rearchitecting the OS, a good way is to allow the CPU (which is busy sharing its resources with non-UI work) to react more quickly is to ensure the CPU is at a higher clock rate before the UI needs it.
As for battery life, it really depends on your usage pattern. If you have a lot of background processing going on, preventing the CPU from going to sleep when idle, you may be better off scaling back the minimum cpufreq frequently. If your CPU actually goes to sleep, give scaling things up a try. A handy tool you can use to see how often the CPU is sleeping is CPU Spy. To see which apps are keeping the CPU awake, there's a program called Better Battery Stats available on XDA and market.
As for stability, I don't mean over clocking the CPU...all I'm suggesting is to increase the frequency the CPU goes to when the screen is on, but nothing much is happening. This should still keep things within safe limits.
Hope this helps,
- chris
I find the interactive governor does a very good job of ramping to max right from idle (instead of waiting even a few ms like ondemand does). It assumes coming out of idle the CPU is starved. Then scales back once demand lowers. No fancy locking to min freq when screen is off (which can stutter some background apps).
There is many thing what can be done in the code of the applications. For example once I had a really sluggish app. It turned out that while I was dragging an item in the UI, the UI needed to be relayouted, and the draw calls were simply postponed: in android (at least that was the case before ICS) the drawing of the UI is delayed while the UI thread is too busy with events and layout requests.
To find these issues it's really useful to use traceview.

CPU Governors explained

Thanks to deedii for posting this in another forum:
http://forum.xda-developers.com/show...65&postcount=2
Android CPU governors explained
1: OnDemand
2: OndemandX
3: Performance
4: Powersave
5: Conservative
6: Userspace
7: Min Max
8: Interactive
9: InteractiveX
10: Smartass
11: SmartassV2
12: Scary
13: Lagfree
14: Smoothass
15: Brazilianwax
16: SavagedZen
17: Lazy
18: Lionheart
19: LionheartX
20: Intellidemand
21: Hotplug
22: BadAss
23: Wheatley
24: Lulzactive
25: Pegasusq/Pegasusd
26: hotplugx
27: AbissPlug
28: MSM DCVS
29: IntelliActive
30: Adaptive
31: Nightmare
32: ZZmove
INFO I/O Scheduler go here: SCHEDULER
1: OnDemand Governor:
This governor has a hair trigger for boosting clockspeed to the maximum speed set by the user. If the CPU load placed by the user abates, the OnDemand governor will slowly step back down through the kernel's frequency steppings until it settles at the lowest possible frequency, or the user executes another task to demand a ramp.
OnDemand has excellent interface fluidity because of its high-frequency bias, but it can also have a relatively negative effect on battery life versus other governors. OnDemand is commonly chosen by smartphone manufacturers because it is well-tested, reliable, and virtually guarantees the smoothest possible performance for the phone. This is so because users are vastly more likely to ***** about performance than they are the few hours of extra battery life another governor could have granted them.
This final fact is important to know before you read about the Interactive governor: OnDemand scales its clockspeed in a work queue context. In other words, once the task that triggered the clockspeed ramp is finished, OnDemand will attempt to move the clockspeed back to minimum. If the user executes another task that triggers OnDemand's ramp, the clockspeed will bounce from minimum to maximum. This can happen especially frequently if the user is multi-tasking. This, too, has negative implications for battery life.
2: OndemandX:
Basically an ondemand with suspend/wake profiles. This governor is supposed to be a battery friendly ondemand. When screen is off, max frequency is capped at 500 mhz. Even though ondemand is the default governor in many kernel and is considered safe/stable, the support for ondemand/ondemandX depends on CPU capability to do fast frequency switching which are very low latency frequency transitions. I have read somewhere that the performance of ondemand/ondemandx were significantly varying for different i/o schedulers. This is not true for most of the other governors. I personally feel ondemand/ondemandx goes best with SIO I/O scheduler.
3: Performance Governor:
This locks the phone's CPU at maximum frequency. While this may sound like an ugly idea, there is growing evidence to suggest that running a phone at its maximum frequency at all times will allow a faster race-to-idle. Race-to-idle is the process by which a phone completes a given task, such as syncing email, and returns the CPU to the extremely efficient low-power state. This still requires extensive testing, and a kernel that properly implements a given CPU's C-states (low power states).
4: Powersave Governor:
The opposite of the Performance governor, the Powersave governor locks the CPU frequency at the lowest frequency set by the user.
5:Conservative Governor:
This biases the phone to prefer the lowest possible clockspeed as often as possible. In other words, a larger and more persistent load must be placed on the CPU before the conservative governor will be prompted to raise the CPU clockspeed. Depending on how the developer has implemented this governor, and the minimum clockspeed chosen by the user, the conservative governor can introduce choppy performance. On the other hand, it can be good for battery life.
The Conservative Governor is also frequently described as a "slow OnDemand," if that helps to give you a more complete picture of its functionality.
6: Userspace Governor:
This governor, exceptionally rare for the world of mobile devices, allows any program executed by the user to set the CPU's operating frequency. This governor is more common amongst servers or desktop PCs where an application (like a power profile app) needs privileges to set the CPU clockspeed.
7: Min Max
well this governor makes use of only min & maximum frequency based on workload... no intermediate frequencies are used.
8: Interactive Governor:
Much like the OnDemand governor, the Interactive governor dynamically scales CPU clockspeed in response to the workload placed on the CPU by the user. This is where the similarities end. Interactive is significantly more responsive than OnDemand, because it's faster at scaling to maximum frequency.
Unlike OnDemand, which you'll recall scales clockspeed in the context of a work queue, Interactive scales the clockspeed over the course of a timer set arbitrarily by the kernel developer. In other words, if an application demands a ramp to maximum clockspeed (by placing 100% load on the CPU), a user can execute another task before the governor starts reducing CPU frequency. This can eliminate the frequency bouncing discussed in the OnDemand section. Because of this timer, Interactive is also better prepared to utilize intermediate clockspeeds that fall between the minimum and maximum CPU frequencies. This is another pro-battery life benefit of Interactive.
However, because Interactive is permitted to spend more time at maximum frequency than OnDemand (for device performance reasons), the battery-saving benefits discussed above are effectively negated. Long story short, Interactive offers better performance than OnDemand (some say the best performance of any governor) and negligibly different battery life.
Interactive also makes the assumption that a user turning the screen on will shortly be followed by the user interacting with some application on their device. Because of this, screen on triggers a ramp to maximum clockspeed, followed by the timer behavior described above.
9: InteractiveX Governor:
Created by kernel developer "Imoseyon," the InteractiveX governor is based heavily on the Interactive governor, enhanced with tuned timer parameters to better balance battery vs. performance. The InteractiveX governor's defining feature, however, is that it locks the CPU frequency to the user's lowest defined speed when the screen is off.
10: Smartass
Is based on the concept of the interactive governor.
I have always agreed that in theory the way interactive works – by taking over the idle loop – is very attractive. I have never managed to tweak it so it would behave decently in real life. Smartass is a complete rewrite of the code plus more. I think its a success. Performance is on par with the “old” minmax and I think smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies.
Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 – why?! – it will cap it to your min frequency). Lets take for example the 528/176 kernel, it will sleep at 352/176. No need for sleep profiles any more!"
11: SmartassV2:
Version 2 of the original smartass governor from Erasmux. Another favorite for many a people. 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. This governor scales down CPU very fast (to hit sleep_ideal_freq soon) while screen is off and scales up rapidly to awake_ideal_freq (500 mhz for GS2 by default) when screen is on. There's no upper limit for frequency while screen is off (unlike Smartass). So the entire frequency range is available for the governor to use during screen-on and screen-off state. The motto of this governor is a balance between performance and battery.
12: Scary
A new governor wrote based on conservative with some smartass features, it scales accordingly to conservatives laws. So it will start from the bottom, take a load sample, if it's above the upthreshold, ramp up only one speed at a time, and ramp down one at a time. It will automatically cap the off screen speeds to 245Mhz, and if your min freq is higher than 245mhz, it will reset the min to 120mhz while screen is off and restore it upon screen awakening, and still scale accordingly to conservatives laws. So it spends most of its time at lower frequencies. The goal of this is to get the best battery life with decent performance. It will give the same performance as conservative right now, it will get tweaked over time.
13: Lagfree:
Lagfree is similar to ondemand. Main difference is it's optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree does not skip any frequency step while scaling up or down. Remember that if there's a requirement for sudden burst of power, lagfree can not satisfy that since it has to raise cpu through each higher frequency step from current. Some users report that video playback using lagfree stutters a little.
14: Smoothass:
The same as the Smartass “governor” But MUCH more aggressive & across the board this one has a better battery life that is about a third better than stock KERNEL
15: Brazilianwax:
Similar to smartassV2. More aggressive ramping, so more performance, less battery
16: SavagedZen:
Another smartassV2 based governor. Achieves good balance between performance & battery as compared to brazilianwax.
17: Lazy:
This governor from Ezekeel is basically an ondemand with an additional parameter min_time_state to specify the minimum time CPU stays on a frequency before scaling up/down. The Idea here is to eliminate any instabilities caused by fast frequency switching by ondemand. Lazy governor polls more often than ondemand, but changes frequency only after completing min_time_state on a step overriding sampling interval. Lazy also has a screenoff_maxfreq parameter which when enabled will cause the governor to always select the maximum frequency while the screen is off.
18: Lionheart:
Lionheart is a conservative-based governor which is based on samsung's update3 source.
The tunables (such as the thresholds and sampling rate) were changed so the governor behaves more like the performance one, at the cost of battery as the scaling is very aggressive.
19: LionheartX
LionheartX is based on Lionheart but has a few changes on the tunables and features a suspend profile based on Smartass governor.
20: 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' (or 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 max 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 busy; to deliver performance for gaming and such. Intellidemand does not jump to highest frequency when screen is off.
21: Hotplug Governor:
The Hotplug governor performs very similarly to the OnDemand governor, with the added benefit of being more precise about how it steps down through the kernel's frequency table as the governor measures the user's CPU load. However, the Hotplug governor's defining feature is its ability to turn unused CPU cores off during periods of low CPU utilization. This is known as "hotplugging."
22: BadAss Governor:
Badass removes all of this "fast peaking" to the max frequency. On a typical system the cpu won't go above 918Mhz and therefore stay cool and will use less power. To trigger a frequency increase, the system must run a bit @ 918Mhz with high load, then the frequency is bumped to 1188Mhz. If that is still not enough the governor gives you full throttle. (this transition should not take longer than 1-2 seconds, depending on the load your system is experiencing)
Badass will also take the gpu load into consideration. If the gpu is moderately busy it will bypass the above check and clock the cpu with 1188Mhz. If the gpu is crushed under load, badass will lift the restrictions to the cpu.
23: Wheatley:
Building on the classic 'ondemand' governor is implemented Wheatley governor. The governor has two additional parameters:
target_residency - The minimum average residency in µs which is considered acceptable for a proper efficient usage of the C4 state. Default is 10000 = 10ms.
allowed_misses - The number sampling intervals in a row the average residency is allowed to be lower than target_residency before the governor reduces the frequency. This ensures that the governor is not too aggressive in scaling down the frequency and reduces it just because some background process was temporarily causing a larger number of wakeups. The default is 5.
Wheatley works as planned and does not hinder the proper C4 usage for task where the C4 can be used properly .
For internet browsing the time spend in C4 has increased by 10% points and the average residency has increased by about 1ms. I guess these differences are mostly due to the different browsing behaviour (I spend the last time more multi-tabbing). But at least we can say that Wheatley does not interfere with the proper use of the C4 state during 'light' tasks. For music playback with screen off the time spend in C4 is practically unchanged, however the average residency is reduced from around 30ms to around 18ms, but this is still more than acceptable.
So the results show that Wheatley works as intended and ensures that the C4 state is used whenever the task allows a proper efficient usage of the C4 state. For more demanding tasks which cause a large number of wakeups and prevent the efficient usage of the C4 state, the governor resorts to the next best power saving mechanism and scales down the frequency. So with the new highly-flexible Wheatley governor one can have the best of both worlds.
Obviously, this governor is only available on multi-core devices.
24: Lulzactive:
Lulzactive:
This new find from Tegrak is based on Interactive & Smartass governors and is one of the favorites.
Old Version: 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. When screen is off, frequency is locked to global scaling minimum frequency.
New Version: Three more user configurable parameters: inc_cpu_load, pump_up_step, pump_down_step. Unlike older version, this one gives more control for the user. We can set the threshold at which governor decides to scale up/down. We can also set number of frequency steps to be skipped while polling up and down.
When workload greater than or equal to inc_cpu_load, governor scales CPU pump_up_step steps up. When workload is less than inc_cpu_load, governor scales CPU down pump_down_step steps down.
Example:
Consider
inc_cpu_load=70
pump_up_step=2
pump_down_step=1
If current frequency=200, Every up_sampling_time Us if cpu load >= 70%, cpu is scaled up 2 steps - to 800.
If current frequency =1200, Every down_sampling_time Us if cpu load < 70%, cpu is scaled down 1 step - to 1000.
25: Pegasusq/Pegasusd
The Pegasus-q / d is a multi-core based on the Ondemand governor and governor with integrated hot-plugging.
Ongoing processes in the queue, we know that multiple processes can run simultaneously on. These processes are active in an array, which is a field called "Run Queue" queue that is ongoing, with their priority values ​​arranged (priority will be used by the task scheduler, which then decides which process to run next).
To ensure that each process has its fair share of resources, each running for a certain period and will eventually stop and then again placed in the queue until it is your turn again. If a program is terminated, so that others can run the program with the highest priority in the current queue is executed.
26: hotplugx
It 'a Hotplug modified and optimized for the suspension in off-screen
27: AbissPlug
It 'a Governor derived hotplug, it works the same way, but with the changes in savings for a better battery.
28: MSM DCVS
a very efficient and wide range of Dynamic Clock and
Voltage Scaling (DCVS) which addresses usage models from
active standby to mid and high level processing requirements.
A Krait CPU can smoothly scale from low power, low
leakage mode to blazingly fast performance.
Believe it's a governor that is mfg'd by qualcomm to utilize new on chip features.
MSM is the prefix for the SOC (MSM8960) and DCVS is Dynamic Clock and Voltage Scaling. Makes sense, MSM-DCVS
29: IntelliActive
Based off Google's Interactive governor with the following enhancements:
1. self-boost capability from input drivers (no need for PowerHAL assist)
2. two phase scheduling (idle/busy phases to prevent from jumping directly to max freq
3. Checks for offline cpus and short circuits some unnecessary checks to improve code execution paths
30: Adaptive
This driver adds a dynamic cpufreq policy governor
designed for latency-sensitive workloads and also for demanding
performance.
This governor attempts to reduce the latency of clock
increases so that the system is more responsive to
interactive workloads in loweset steady-state but to
to reduce power consumption in middle operation level level up
will be done in step by step to prohibit system from going to
max operation level.
31: Nightmare
A PegasusQ modified, less aggressive and more stable. A good compromise between performance and battery.
In addition to the SoD is a prevention because it usually does not hotplug.
32: ZZmove
ZZmove Governor optimized for low power consumption with the screen off, with particular attention to the limitation of consumption applications in the background with the screen off, such as listening to music. It has three settings: battery saver, balanced and performance. In addition to a performance boost, there is also the governor zzmove optimized.
Credits goes to:
http://icrontic.com/discussion/95140...m-tuner-tegrak
http://forum.xda-developers.com/show....php?t=1369817
NICE!
Really nice job there but badass governor is missing
Sent From My Sexy Sensation.
Very informative, thanks..could u also add a description for the new pegasus governor
Sent from my HTC Sensation 4G using Xparent Blue Tapatalk 2
I'll put to work
Where does bricked kernels badass fit in? What is it most similar to?
This was a good read, thanks for taking the time to write it up
kingston73 said:
Where does bricked kernels badass fit in? What is it most similar to?
Click to expand...
Click to collapse
perhaps because the translator, but I can not understand the question
Show-p's bricked kernel has a governer called "badass" and I wanted to know which kernel is most like his?
kingston73 said:
Show-p's bricked kernel has a governer called "badass" and I wanted to know which kernel is most like his?
Click to expand...
Click to collapse
I put badass to the list so you can compare and see which governor is right for you
thanks for the explanations, i was confused about what governor to choose and what each one did, but this explains everything in one place well done!
julio_rdz said:
thanks for the explanations, i was confused about what governor to choose and what each one did, but this explains everything in one place well done!
Click to expand...
Click to collapse
thanks, I'm glad this is useful for users
There are waaay to many governors(incl custom), many actually aren't even significantly different from another. If you ask me I say all we need is conservative, ondemand, and not performance(pointless+battery rape). Although I don't mind the x versions of the ones I listed, but that's just b/c I like the x nomenclature.
Excellent explanation!
Thank you very much!!
Anyone know a mod to keep my device cool-er while on badass
@OP great job on the explanation extremely useful.
Mr.Highway said:
Anyone know a mod to keep my device cool-er while on badass
@OP great job on the explanation extremely useful.
Click to expand...
Click to collapse
reflash the kernel using the below settings
keep 2d and 3d to default (most of the heating issues comes from gpu overclocks) and freq to default
also use battery saver configuration (it handles cpu freq transitions) (its not laggy btw)
on the contrary you can use iba's badass mod's but they are told to be placebo's (by the badass dev itself)
Mr.Highway said:
Anyone know a mod to keep my device cool-er while on badass
@OP great job on the explanation extremely useful.
Click to expand...
Click to collapse
You can also use this mod, it works great :http://forum.xda-developers.com/showthread.php?t=1641605
Several requests by, before long new incoming governor
Can you find an explanation for, and include, the wheatley governor please?
slopra said:
Can you find an explanation for, and include, the wheatley governor please?
Click to expand...
Click to collapse
I'm also working on it, just realized the work I insert

[GUIDE] CPU Governors Explained in Detail for Android....

Many of us don't know what is CPU Governor's and which suites them perfectly, so after doing some Googling i am writing these.
What is a CPU governor?
A CPU governor in Android controls how the CPU raises and lowers its frequency in response to the demands the user is placing on their device. Governors are especially important in smartphones and tablets because they have a large impact on the apparent fluidity of the interface and the battery life of the device over a charge.
NOTE: You cannot change your CPU governor unless your phone is rooted and you have a ROM or app that lets you make a change. Also, different kernels (the intermediary software between your phone's hardware and the operating system) offer different sets of governors.
S/W or App's for using these features:
1. SetCPU.
2. No-frills CPU.
3. Tegrak Overclock.
1. Smartass: Performance is on par with the “old” minmax and smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies.
Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 it will cap it to your min frequency).
2. SmartassV2: Version 2 of the original smartass governor from Erasmux. Another favorite for many a people. 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. This governor scales down CPU very fast (to hit sleep_ideal_freq soon) while screen is off and scales up rapidly to awake_ideal_freq when screen is on. There's no upper limit for frequency while screen is off (unlike Smartass). So the entire frequency range is available for the governor to use during screen-on and screen-off state. The motto of this governor is a balance between performance and battery.
3. SavagedZen: Another smartassV2 based governor. Achieves good balance between performance & battery.
4. Ondemand: which would instantly go to max frequency once it detects cpu activity and then scales down as the requirement decreases.
5. Performance: It has the same min and max frequency so I guess your phone will heat up and throttle really quick, although if you want to benchmark this would give you the best result.
6. Interactive: Much like the OnDemand governor, the Interactive governor dynamically scales CPU clockspeed in response to the workload placed on the CPU by the user. This is where the similarities end. Interactive is significantly more responsive than OnDemand, because it's faster at scaling to maximum frequency.
Unlike OnDemand, which you'll recall scales clockspeed in the context of a work queue, Interactive scales the clockspeed over the course of a timer set arbitrarily by the kernel developer. In other words, if an application demands a ramp to maximum clockspeed (by placing 100% load on the CPU), a user can execute another task before the governor starts reducing CPU frequency. This can eliminate the frequency bouncing discussed in the OnDemand section. Because of this timer, Interactive is also better prepared to utilize intermediate clockspeeds that fall between the minimum and maximum CPU frequencies. This is another pro-battery life benefit of Interactive.
However, because Interactive is permitted to spend more time at maximum frequency than OnDemand (for device performance reasons), the battery-saving benefits discussed above are effectively negated. Long story short, Interactive offers better performance than OnDemand (some say the best performance of any governor) and negligibly different battery life.
7. InteractiveX: Created by kernel developer "Imoseyon," the InteractiveX governor is based heavily on the Interactive governor, enhanced with tuned timer parameters to better balance battery vs. performance. The InteractiveX governor's defining feature, however, is that it locks the CPU frequency to the user's lowest defined speed when the screen is off.
8. Pegasusq: The Pegasus-q / d is a multi-core based on the Ondemand governor and governor with integrated hot-plugging.
Ongoing processes in the queue, we know that multiple processes can run simultaneously on. These processes are active in an array, which is a field called "Run Queue" queue that is ongoing, with their priority values arranged (priority will be used by the task scheduler, which then decides which process to run next).
To ensure that each process has its fair share of resources, each running for a certain period and will eventually stop and then again placed in the queue until it is your turn again. If a program is terminated, so that others can run the program with the highest priority in the current queue is executed.
9. Abyssplug: from what I have read is a modified hotplug which is simillar to ondemand but has the ability to turn off a core when it is not needed and is a little more precise in scaling down cpu performance.
10. Lazy: This governor from Ezekeel is basically an ondemand with an additional parameter min_time_state to specify the minimum time CPU stays on a frequency before scaling up/down. The Idea here is to eliminate any instabilities caused by fast frequency switching by ondemand. Lazy governor polls more often than ondemand, but changes frequency only after completing min_time_state on a step overriding sampling interval. Lazy also has a screenoff_maxfreq parameter which when enabled will cause the governor to always select the maximum frequency while the screen is off.
11. Powersave: This is opposite of the Performance governor, the Powersave governor locks the CPU frequency at the lowest frequency set by the user.
12. Lagfree: This is similar to ondemand. Main difference is it's optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree does not skip any frequency step while scaling up or down. Remember that if there's a requirement for sudden burst of power, lagfree can not satisfy that since it has to raise cpu through each higher frequency step from current. Some users report that video playback using lagfree stutters a little.
Now you decide it on your own which will suite you ....
Hope this helped you .......
Source
Thanks mj for the wonderful explanation... Learnt some stuff..
Sent from my GT-I9103
Well done. Great work.
This is good work.:good:
I found this thread and this. It explains many more governers.....if any one is interested!:good:
If anyone is interested to know about I/O schedulers...a term that is very commonly used along with CPU governors, refer this
Could you also explain on how to use it ??
I m completely noob...are these governors bundled with kernel or thru some app ??
Sent from my GT-I9103 using Tapatalk 2
vipul12389mehta said:
Could you also explain on how to use it ??
I m completely noob...are these governors bundled with kernel or thru some app ??
Sent from my GT-I9103 using Tapatalk 2
Click to expand...
Click to collapse
NOTE:
You cannot change your CPU governor unless your phone is rooted and you have a ROM or app that lets you make a change. Also, different kernels (the intermediary software between your phone's hardware and the operating system) offer different sets of governors.
Quoted from here
Good job. Can you please add a source of this information?
Thank You OP ! Im now using abyssplug and it saves my battery so much !! Also with a good performance while gaming too !!
Sent from my GT-I9103 using xda app-developers app
what does save most battery for our galaxy r ?
Sent from my GT-I9103 using xda premium
vipul12389mehta said:
Could you also explain on how to use it ??
I m completely noob...are these governors bundled with kernel or thru some app ??
Click to expand...
Click to collapse
These Governor's are related to Kernel, when Kernel is developed these will be coded into kernel and we can select them by using App's like "Set CPU" or "No frill CPU".
"No frill CPU" is free and similar to set CPU...
Eg: In Horsepower kernel developed by fuss132 for Galaxy R we are having most of these Governor's...
m.kochan10 said:
Good job. Can you please add a source of this information?
Click to expand...
Click to collapse
Source added to OP...
Birki96 said:
what does save most battery for our galaxy r ?
Click to expand...
Click to collapse
As rhodrhi said you can try abyssplug or Powersave ( I forgor about this i will add it to OP) and Under clock the CPU will save some power....
Eg: When screen is off i will set it to max 780 and min 256 ( Presently i don't have mobile with me so i don't remember exactly the frequency's)....
Can some one tell me how the lagfree governer works on sgr? I am actually getting good smooth response on this governer and also it does not eat too much of battery...
How about others?
Sent from my GT-I9103
bhargav143 said:
Can some one tell me how the lagfree governer works on sgr? I am actually getting good smooth response on this governer and also it does not eat too much of battery...
How about others?
Click to expand...
Click to collapse
Lagfree: This is similar to ondemand. Main difference is it's optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree does not skip any frequency step while scaling up or down. Remember that if there's a requirement for sudden burst of power, lagfree can not satisfy that since it has to raise cpu through each higher frequency step from current. Some users report that video playback using lagfree stutters a little.
I will add this to OP.
mj.vikram said:
7. InteractiveX: Created by kernel developer "Imoseyon," the InteractiveX governor is based heavily on the Interactive governor, enhanced with tuned timer parameters to better balance battery vs. performance. The InteractiveX governor's defining feature, however, is that it locks the CPU frequency to the user's lowest defined speed when the screen is off.
Source
Click to expand...
Click to collapse
How does DEEP SLEEP mode play into all of this?
Does this governor prevent DEEP SLEEP when the phone screen is off since it locks it at the lowest speed?
Neo3D said:
How does DEEP SLEEP mode play into all of this?
Does this governor prevent DEEP SLEEP when the phone screen is off since it locks it at the lowest speed?
Click to expand...
Click to collapse
+1
Sent from my GT-I9103 using xda premium
Neo3D said:
How does DEEP SLEEP mode play into all of this?
Does this governor prevent DEEP SLEEP when the phone screen is off since it locks it at the lowest speed?
Click to expand...
Click to collapse
drarunmmc said:
+1
Click to expand...
Click to collapse
Deep sleep is basically your phone going into a low CPU state and it's most likely enabled in all the kernel's by default irrespective of all Governor's ....
Install the app CPU Spy which will let you know the Time spent in each CPU frequency including deep sleep also....
Thnx
Great explaination :good:
Well done. Great work.
Thanks
..very informative! thank you very much for this info, it helps me a lot :good:
mj.vikram said:
Many of us don't know what is CPU Governor's and which suites them perfectly, so after doing some Googling i am writing these.
What is a CPU governor?
A CPU governor in Android controls how the CPU raises and lowers its frequency in response to the demands the user is placing on their device. Governors are especially important in smartphones and tablets because they have a large impact on the apparent fluidity of the interface and the battery life of the device over a charge.
NOTE: You cannot change your CPU governor unless your phone is rooted and you have a ROM or app that lets you make a change. Also, different kernels (the intermediary software between your phone's hardware and the operating system) offer different sets of governors.
S/W or App's for using these features:
1. SetCPU.
2. No-frills CPU.
3. Tegrak Overclock.
1. Smartass: Performance is on par with the “old” minmax and smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies.
Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 it will cap it to your min frequency).
2. SmartassV2: Version 2 of the original smartass governor from Erasmux. Another favorite for many a people. 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. This governor scales down CPU very fast (to hit sleep_ideal_freq soon) while screen is off and scales up rapidly to awake_ideal_freq when screen is on. There's no upper limit for frequency while screen is off (unlike Smartass). So the entire frequency range is available for the governor to use during screen-on and screen-off state. The motto of this governor is a balance between performance and battery.
3. SavagedZen: Another smartassV2 based governor. Achieves good balance between performance & battery.
4. Ondemand: which would instantly go to max frequency once it detects cpu activity and then scales down as the requirement decreases.
5. Performance: It has the same min and max frequency so I guess your phone will heat up and throttle really quick, although if you want to benchmark this would give you the best result.
6. Interactive: Much like the OnDemand governor, the Interactive governor dynamically scales CPU clockspeed in response to the workload placed on the CPU by the user. This is where the similarities end. Interactive is significantly more responsive than OnDemand, because it's faster at scaling to maximum frequency.
Unlike OnDemand, which you'll recall scales clockspeed in the context of a work queue, Interactive scales the clockspeed over the course of a timer set arbitrarily by the kernel developer. In other words, if an application demands a ramp to maximum clockspeed (by placing 100% load on the CPU), a user can execute another task before the governor starts reducing CPU frequency. This can eliminate the frequency bouncing discussed in the OnDemand section. Because of this timer, Interactive is also better prepared to utilize intermediate clockspeeds that fall between the minimum and maximum CPU frequencies. This is another pro-battery life benefit of Interactive.
However, because Interactive is permitted to spend more time at maximum frequency than OnDemand (for device performance reasons), the battery-saving benefits discussed above are effectively negated. Long story short, Interactive offers better performance than OnDemand (some say the best performance of any governor) and negligibly different battery life.
7. InteractiveX: Created by kernel developer "Imoseyon," the InteractiveX governor is based heavily on the Interactive governor, enhanced with tuned timer parameters to better balance battery vs. performance. The InteractiveX governor's defining feature, however, is that it locks the CPU frequency to the user's lowest defined speed when the screen is off.
8. Pegasusq: The Pegasus-q / d is a multi-core based on the Ondemand governor and governor with integrated hot-plugging.
Ongoing processes in the queue, we know that multiple processes can run simultaneously on. These processes are active in an array, which is a field called "Run Queue" queue that is ongoing, with their priority values arranged (priority will be used by the task scheduler, which then decides which process to run next).
To ensure that each process has its fair share of resources, each running for a certain period and will eventually stop and then again placed in the queue until it is your turn again. If a program is terminated, so that others can run the program with the highest priority in the current queue is executed.
9. Abyssplug: from what I have read is a modified hotplug which is simillar to ondemand but has the ability to turn off a core when it is not needed and is a little more precise in scaling down cpu performance.
10. Lazy: This governor from Ezekeel is basically an ondemand with an additional parameter min_time_state to specify the minimum time CPU stays on a frequency before scaling up/down. The Idea here is to eliminate any instabilities caused by fast frequency switching by ondemand. Lazy governor polls more often than ondemand, but changes frequency only after completing min_time_state on a step overriding sampling interval. Lazy also has a screenoff_maxfreq parameter which when enabled will cause the governor to always select the maximum frequency while the screen is off.
11. Powersave: This is opposite of the Performance governor, the Powersave governor locks the CPU frequency at the lowest frequency set by the user.
12. Lagfree: This is similar to ondemand. Main difference is it's optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree does not skip any frequency step while scaling up or down. Remember that if there's a requirement for sudden burst of power, lagfree can not satisfy that since it has to raise cpu through each higher frequency step from current. Some users report that video playback using lagfree stutters a little.
Now you decide it on your own which will suite you ....
Hope this helped you .......
Source
Click to expand...
Click to collapse
Thanks man this helps me understand a little ore of configuring a nandroid. :highfive:

Modify thermal config+init.qcom.post_boot-1.sh

I just need thermal config+init.qcom.post_boot-1.sh with some modification...
My requirements are as follows...
1) dont care about heating.
2) cpu governor- interactive
3) min clock frequency- 100 mhz for all cpu
4) maximum clock frequency- no limit
5) camera app not depends on temperature ( hang or slow at high temperature).
6) remove all cpu throttling...(must need)
7) remove cpu offline algorithm... (Must need)
Anyone here which is capable of doing this thing,please help...
my thermal config has it all. have you check ?
only the cpu freq I don't set as low as 200 in interactive. (the minimum) you'll get lag and slow respon. believe me.
but I can change if you want.
http://en.miui.com/thread-140563-1-1.html
thanks...
Thanks dude for your advice but i tested your procedures,after that still some cores shut down according to temperature...
i know your skill,so lets join my algorithm and your skill to make best config files...
1) dont care about heating.
2) cpu governor- interactive
3) min clock frequency- 200 mhz for all cpu
4) maximum clock frequency- no limit
5) camera app not depends on temperature ( hang or slow at high temperature).
6) remove all cpu throttling...(must need)
7) remove cpu offline algorithm... (Must need)
and dont confuse between hotplug and throttling(hotplugging is turn unused CPU cores off during periods of low CPU utilization and throttling is turn CPU cores off according to temperature)...
also if you can do then set first 4 core(1.65 mhz x 4) at interactive and others (1.1 mhz x 4) at ondemand...
believe me...this makes best algorithm to control heating and increase performane
Rockmee said:
Thanks dude for your advice but i tested your procedures,after that still some cores shut down according to temperature...
i know your skill,so lets join my algorithm and your skill to make best config files...
1) dont care about heating.
2) cpu governor- interactive
3) min clock frequency- 200 mhz for all cpu
4) maximum clock frequency- no limit
5) camera app not depends on temperature ( hang or slow at high temperature).
6) remove all cpu throttling...(must need)
7) remove cpu offline algorithm... (Must need)
and dont confuse between hotplug and throttling(hotplugging is turn unused CPU cores off during periods of low CPU utilization and throttling is turn CPU cores off according to temperature)...
also if you can do then set first 4 core(1.65 mhz x 4) at interactive and others (1.1 mhz x 4) at ondemand...
believe me...this makes best algorithm to control heating and increase performane
Click to expand...
Click to collapse
if you're talking about cpu2 & cpu3 still offline then I can't help.. it's because of the kernel.
they are active as per need though , not totally offline.
thermal config should be good for your need (if you want can remove all the SS-CPU in there )
https://drive.google.com/file/d/0B7YlmAzhAoSxanpPNTdPSlgxZG8/view
post_boot.sh later.. ( i think Keasby has one with mix interactive/ondemand)
Explain
thanks for your hard work but can you tell me changelog of this config files according to my requirement...
Thanx but there is a problem
Yes you here right,i just checked your config file,i think this is perfect mod but it does not support miui 6.7.2... After some time frequency of first four core set to 1651 mhz and rest at 800 mhz...please fix this issue,it makes heating issue...

[MOD][ROOT] Interactive an alternative to stock ondemand cpu governor on M2

I'm not a Dev. but for a while i was chasing the unicorn. I wanted to find a setting on my xperia M2 that gives battery and performance.. My phone got really hot after 20-30 min of usage on stock settings. So I thought there must be different ways to this. I use a custom rom Z5 style, it has the standard kernel as far as I know.
I studied some writings about governors like: http://forum.xda-developers.com/xperia-m2/general/ref-xperia-m2-cpu-governors-hotplugging-t3454006 and the main reason why I started tweaking with Interactive governor is this very useful thread: http://forum.xda-developers.com/showthread.php?t=2769899
As U can see I only used what was already on here I just wanted to share my current settings as i find them fast enough for daily use and quite battery friendly..
In the second thread you have a really good explanation on interactive and i find it to be a very versatile governor. MP decision is off with these settings.
Anyhow back to my settings.. I use Kernel Aduitor (an older mod version) to change my settings, it works for me the best.
1. setting is above_hispeed_delay I changed it to: 10000 787200:35000 998400:45000
2. boost : leave it at 0
3. boostpulse_duration: change to 0
4. go_hispeed_load: 95
5. hispeed_freq: 787200
6. io_is_busy_ 0
7. min_sample_time: 30000
8. sampling_down_factor:1
9. sync_freq:300000
10. target loads: 80 384000:85 600000:90 787200:95 998400:99
11. timer_rate: 30000
12. timer_slack: 50000
13. up_threshold_any_cpu_freq: 0
14 up_threshold_any_cpu_load: 0
If U try it, change it and find something that works better with less battery please write back!
Edit
I did some changes to the numbers, its a bit smoother and SOT with my type of usage is around 6-8% drop per hour on my phone.
This is a battery oriented setup with MP decision off. My usage profile involves a lot of reading so it is not that cpu intensive. Results may be different for You!
NOTE!
If U would like to have more performance try the Hawktail profile suggested by AutumQueen92 lower in the tread is the link
Awesome work bro...
Best battery backup!!!
semil said:
I'm not a Dev. but for a while i was chasing the unicorn. I wanted to find a setting on my xperia M2 that gives battery and performance.. My phone got really hot after 20-30 min of usage on stock settings. So I thought there must be different ways to this. I use a custom rom Z5 style, it has the standard kernel as far as I know.
I studied some writings about governors like: http://forum.xda-developers.com/xperia-m2/general/ref-xperia-m2-cpu-governors-hotplugging-t3454006 and the main reason why I started tweaking with Interactive governor is this very useful thread: http://forum.xda-developers.com/showthread.php?t=2769899
As U can see I only used what was already on here I just wanted to share my current settings as i find them fast enough for daily use and quite battery friendly..
In the second thread you have a really good explanation on interactive and i find it to be a very versatile governor.
Anyhow back to my settings.. I use Kernel Aduitor (an older mod version) to change my settings, it works for me the best.
1. setting is above_hispeed_delay I changed it to: 10000 998400:50000 1094400:30000
2. boost : leave it at 0
3. boostpulse_duration: change to 0
4. go_hispeed_load: 95
5. hispeed_freq: 787200
6. io_is_busy_ 0
7. min_sample_time: 30000
8. sampling_down_factor:0
9. sync_freq:0
10. target loads: 99 600000:95 998400:99
11. timer_rate: 20000
12. timer_slack: 40000
13. up_threshold_any_cpu_freq: 0
14 up_threshold_any_cpu_load: 0
If U try it, change it and find something that works better with less battery please write back!
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=68223776&postcount=4203
You're linking to an old site, the newer one is here. Also, I get better SOT and performance with Hawktail. Set your sampling_down_factor to 1 (stock Android setting, not sure why Sony made it 0) and sync_freq to 787200 (sets all cores to this frequency depending on CPU load)
Hi thx for the reply sadly there is no kernel with Hawktail for the M2 as far as I know.. for sampling_down_factor ill try.
semil said:
Hi thx for the reply sadly there is no kernel with Hawktail for the M2 as far as I know.. for sampling_down_factor ill try.
Click to expand...
Click to collapse
???
Hawktail is the profile name, not governor. You just take all their values except the ones that needs our own CPU frequency like in the attachment.
Oh did not know sry. I will try those settings and compare.
Do you have MP decision on or off? I have it off. These hawktail settings shortened my SOT considerably today. Performance is crisp that is true, but better SOT? not for me.
semil said:
Do you have MP decision on or off? I have it off. These hawktail settings shortened my SOT considerably today. Performance is crisp that is true, but better SOT? not for me.
Click to expand...
Click to collapse
MPdecisions is turned on, because there are no other hotplugs. When mpdecision is turned off, all 4 of your cores are constantly turned on and locked at 787mhz. If your SOT shortened try the GhostPepper profile or experiment with your own profiles. Some people do have different times on profiles because of usage patterns
That was the case yes. I leave hotplug off. Actually all four cores are on all the time but when idling on 300 MHZ it does not use much juice really. I read somewhere that switching cores on/off actually uses a lot of battery. With my usage pattern SOT is better with hotplug off..
semil said:
That was the case yes. I leave hotplug off. Actually all four cores are on all the time but when idling on 300 MHZ it does not use much juice really. I read somewhere that switching cores on/off actually uses a lot of battery. With my usage pattern SOT is better with hotplug off..
Click to expand...
Click to collapse
I see, that sounds good. Then sync_freq should be set to to minimum frequency too, otherwise they lock up at higher freqs.
Can anyone provide with a "explain me like I'm five" post of what is this about? And if it is as good as it sounds?
Vadeinspace said:
Can anyone provide with a "explain me like I'm five" post of what is this about? And if it is as good as it sounds?
Click to expand...
Click to collapse
Hi, its about the governor that runs your cpu. Interactive is very easy to customize: it can be fast or it can be battery friendly but slower. These settings are a good compromise for me but might not be fast enough for You. The Hawktail settings are really fast, similar in fact to 6.0 settings. Your phone should be rooted and with a kernel that has interactive. With a kernel aduitor type of apk You can easily try out different settings.

Categories

Resources