Governors, I/O Schedulers, Optimization Tips for Android

Have you unlocked your bootloader of your current device ? If so, read it ! If not, learn the benifits !


What is this thread about ? It is a very brief explanation of every governors and schedulers to let you find the best combo for your device.

I’ve been searching a lot about informations about Kernels, Governors, I/O Schedulers and also Android Optimization Tips. No matter its Google or XDA or other android forums. I will go into it and try the best I can to find these infos. So I thought of sharing it to here for the Mini, Mini Pro, Active and also Live with Walkman users.

My main reason to share this is to benefit users for better knowledge about Kernels, Governors, I/O Schedulers and Tips on Android Optimization. I’m not aware of whether where this should be posted, its related to kernels, governors and schedulers so I think it would be best if I share it to here. Yes, I wrote it word by word with references.Happy learning. angel Governors, I/O Schedulers, Optimization Tips for Android

After months on XDA, no matter its in a development forum or Off Topic forum. Users kept on asking what’s this what’s that. And I’m sure that not all members will understand what is it until they bump into my thread

FAQs regarding on :-
-I/O Schedulers
-Kernel Governers
-Better RAM
-Better Battery
-FAQs

Quote:
*Will add more when I found something useful.

I do a lot of asking by PM, to learn, it doesn’t matter whether its a stupid one. (People who know me understands)
With my experience and lots of asking. I managed to find a lot of infos that we can use to optimize our phone.

I will try to explain as clear as I can.

Governors :-
-Smoothass
-Smartass
-SmartassV2
-SavagedZen
-Interactivex
-Lagfree
-Minmax
-Ondemand
-Conservative
-Brazilianwax
-Userspacce
-Powersave
-Performance
-Scary
-Lulzactive *
-Intellidemand *
-Badass *
-Lionheart *
-Lionheartx *
-Virtuous *

* Not yet available in current kernels in this forum

Explanation
OnDemand

Quote:
Brief
Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point, OnDemand will rapidly scale the CPU up to meet the demand, then gradually scale the CPU down when it isn’t needed.

Review
Brief says all. By a simple explantion, OnDemand scales up to the required frequency to undergo the action you are doing and rapidly scales down after use.

Conservative

Quote:
Brief
It is similar to the OnDemand governor, but will scale the CPU up more gradually to better fit demand. Conservative governor provides a less responsive experience than OnDemand, but it does save batter

Review
Conservative is the opposite of Interactive; it will slowly ramp up the frequency, then quickly drops the frequency once the CPU is no longer under a certain usage.

Interactive

Quote:
Brief
Available in latest kernels, it is the default scaling option in some stock kernels. Interactive governor is similar to the OnDemand governor with an even greater focus on responsiveness.

Review
Interactive is the opposite of Conservative; it quickly scales up to the maximum allowed frequency, then slowly drops the frequency once no longer in use.

Performance

Quote:
Brief
Performance governer 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. After that it returns the CPU to extremely efficient low-power state.

Review
Good at gaming, Really good. Disadvantages are it may damage your phone if too much usage.

Powersave

Quote:
Brief
The opposite of the Performance governor, the Powersave governor locks the CPU frequency at the lowest frequency set by the user.

Review
Set it to your desired minimum frequency and you won’t have to look for your charger for once in a while.

Scary

Quote:
Brief
A new governor wrote based on Conservative with some Smartass features, it scales accordingly to Conservative’s way. It will start from the bottom. 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.

Review
Hmm.. Overall I don’t see any difference. After I understand its main objective. I was very curious and decided to use it again. Results are the same.. No difference. Report to me if anyone has tested this.

Userspace

Quote:
Brief
Userspace is not a governor pre-set, but instead allows for non-kernel daemons or apps with root permissions to control the frequency. Commonly seen as a redundant and not useful since SetCPU and NoFrills exist.

Review
Highly not recommended for use.

Smartass

Quote:
Brief
It is based on the concept of the Interactive governor.
Smartass is a complete rewrite of the code of Interactive. 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.

Review
Smartass is rather the governer that will save your battery and make use of your processor for daily use. Like the brief explantion said ” Smartass will spend much more time on lower frequencies.” So logically you don’t need for sleep profiles anymore.

SmartassV2

Quote:
Brief
Theoretically a merge of the best properties of Interactive and OnDemand; automatically reduces the maximum CPU frequency when phone is idle or asleep, and attempts to balance performance with efficiency by focusing on an “ideal” frequency.

Review
This is a much favourite to everybody. I believe almost everyone here is using SmartassV2. Yes, it is better than Smartass because of its speed no scaling frequencies from min to max at a short period of time.

Smoothass

Quote:
Brief
A much more aggressive version of Smartass that is very quick to ramp up and down, and keeps the idle/asleep maximum frequency even lower.

Review
In my personal experience, this is really useful for daily use. And yes, I’m using it all the time. It may decrease your battery life. I saw it OC itself to 1.4 gHz when I set it to 1.2. Good use. Recommended.

Brazilianwax

Quote:
Brief
Similar to SmartassV2. More aggressive scaling, so more performance, but less battery.

Review
Based on SmartassV2. But its advantage is a much more performance wise governor.

SavagedZen

Quote:
Brief
Another SmartassV2 based governor. Achieves good balance between performance & battery as compared to Brazilianwax.

Review
Not much difference compared to SmartassV2. But it is a optimized version of it.

Lagfree

Quote:
Brief
Again, similar to Smartass but based on Conservative rather than Interactive, instantly jumps to a certain CPU frequency after the device wakes, then operates similar to Conservative. However, it has been noted as being very slow when down-scaling, taking up to a second to switch frequencies.

Review
Used it before. Like the name of the governor, I didn’t experience any lag whatsoever. Another governor based on performance, but not battery efficient.

MinMax

Quote:
Brief
MinMax is just a normal governor. No scaling intermediate frequency scaling is used.

Review
Well.. it’s too normal that I can’t really say anything about it..

Interactivex

Quote:
Brief
InteractiveX governor is based heavily on the Interactive governor, enhanced with tuned timer parameters to optimize the balance of battery vs performance. 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.

Review
A better understanding from the brief to you users, this is an Interactive governor with a wake profile. More battery friendly than Interactive.

Due to current kernels doesn’t have these governors. I will be delaying the explanation, its very interesting. If you want it ASAP, post below smile Governors, I/O Schedulers, Optimization Tips for Android
-Lulzactive *
-Intellidemand *
-Badass *
-Lionheart *
-Lionheartx *
-Virtuous *
************************************************** ************************************************** ************************************************** ****************

I/O Schedulers(thanks to droidphile)

Deadline

Quote:
Goal is to minimize I/O latency or starvation of a request. The same is achieved by round robin policy to be fair among multiple I/O requests. Five queues are aggressively used to reorder incoming requests.

Advantages:

  • Nearly a real time scheduler.
  • Excels in reducing latency of any given single I/O.
  • Best scheduler for database access and queries.
  • Bandwidth requirement of a process – what percentage of CPU it needs, is easily calculated.
  • Like noop, a good scheduler for solid state/flash drives.

Disadvantages:

  • When system is overloaded, set of processes that may miss deadline is largely unpredictable.

Noop

Quote:
Inserts all the incoming I/O requests to a First In First Out queue and implements request merging. Best used with storage devices that does not depend on mechanical movement to access data. Advantage here is that flash drives does not require reordering of multiple I/O requests unlike in normal hard drives.

Advantages:

  • Serves I/O requests with least number of cpu cycles. (Battery friendly?)
  • Best for flash drives since there is no seeking penalty.
  • Good throughput on db systems.

Disadvantages:

  • Reduction in number of cpu cycles used is proportional to drop in performance.

Anticipatory

Quote:
Based on two facts
i) Disk seeks are really slow.
ii) Write operations can happen whenever, but there is always some process waiting for read operation.

So anticipatory prioritize read operations over write. It anticipates synchronous read operations.

Advantages:

  • Read requests from processes are never starved.
  • As good as noop for read-performance on flash drives.

Disadvantages:

  • ‘Guess works’ might not be always reliable.
  • Reduced write-performance on high performance disks.

BFQ

Quote:
nstead of time slices allocation by CFQ, BFQ assigns budgets. Disk is granted to an active process until it’s budget (number of sectors) expires. BFQ assigns high budgets to non-read tasks. Budget assigned to a process varies over time as a function of it’s behavior.

Advantages:

  • Believed to be very good for usb data transfer rate.
  • Believed to be the best scheduler for HD video recording and video streaming. (because of less jitter as compared to CFQ and others)
  • Considered an accurate i/o scheduler.
  • Achieves about 30% more throughput than CFQ on most workloads.

Disadvantages:

  • Not the best scheduler for benchmarking.
  • Higher budget assigned to a process can affect interactivity and increased latency.

CFQ

Quote:
Completely Fair Queuing scheduler maintains a scalable per-process I/O queue and attempts to distribute the available I/O bandwidth equally among all I/O requests. Each per-process queue contains synchronous requests from processes. Time slice allocated for each queue depends on the priority of the ‘parent’ process. V2 of CFQ has some fixes which solves process’ i/o starvation and some small backward seeks in the hope of improving responsiveness.

Advantages:

  • Considered to deliver a balanced i/o performance.
  • Easiest to tune.
  • Excels on multiprocessor systems.
  • Best database system performance after deadline.

Disadvantages:

  • Some users report media scanning takes longest to complete using CFQ. This could be because of the property that since the bandwidth is equally distributed to all i/o operations during boot-up, media scanning is not given any special priority.
  • Jitter (worst-case-delay) exhibited can sometimes be high, because of the number of tasks competing for the disk.

SIO

Quote:
Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests. No priority quesues concepts, but only basic merging. Sio is a mix between noop & deadline. No reordering or sorting of requests.

Advantages:

  • Simple, so reliable.
  • Minimized starvation of requests.

Disadvantages:

  • Slow random-read speeds on flash drives, compared to other schedulers.
  • Sequential-read speeds on flash drives also not so good.

VR

Quote:
Unlike other schedulers, synchronous and asynchronous requests are not treated separately, instead a deadline is imposed for fairness. The next request to be served is based on it’s distance from last request.

Advantages:

  • May be best for benchmarking because at the peak of it’s ‘form’ VR performs best.

Disadvantages:

  • Performance fluctuation results in below-average performance at times.
  • Least reliable/most unstable.

************************************************** ************************************************** ************************************************** ****************

Android Optimization Tips

Want more free RAM/Better Battery Life/More performance ?
There’s a lot of ways available for optimizing. Some of them are crap and some of them are actually useful.
Here I will guide you on HOW TO MAKE FULL USE MY TIPS.

Guides/Explanation that needs Modding

 
LowMemoryKiller (thanks to pikachu01)
LowMemoryKiller is a constant debate between more free RAM and more multitasking capabilities as free RAM.
It is actually a feature in the Android OS for better memory management.
You can read more about it HERE

This is an important feature due to the perennial problem of having low free memory causing lagginess and slowness in launching apps. When you have free memory lingering around the number of 40MB or less, the Android OS just lags like LOL.

What this would mean is, you would want to tweak the LMK to not have the situation of it having less than 40MB (or even close to that).
The modern Linux machine in the Android ecosystem relies on a mechanism called Low Memory Killer (LMK) to consistently free up RAM. This is due to Android’s internal mechanism of caching apps (and never fully exiting them) when you press the back button. This is to enable faster app switching and provide a seamless experience for apps usage model. Android also, by itself will also constantly look for often used apps to cache them for faster app opening. This will happen even before your system fully boots.

Now, when you mention LMK, the most obvious thoughts that come up are minfrees and Out Of Memory (OOM) groupings. Yes, those two are integral parts when it comes to LMK. The issue here is that no one actually mentioned that there are two LMK systems in Android, that being:
- Linux LMK
- Android Dalvik VM LMK

Both are separate entities that kills/removes app/dalvik cache from RAM when RAM reaches a certain level.

What confuses most people is that the OOM groupings of both mechanisms have the same names being (Android 2.3 based):

Quote:
LMK App Categories

FOREGROUND_APP: Your apps in the foreground, being used currently, interfacing with the user.

VISIBLE_APP: Visible app that is still viewable by the user, but not interacting with the user, example could be apps that reside in the status bar, and giving live information i.e. Os monitor graphs.

PERCEPTIBLE_APP: App that the user can still perceive i.e. Music app that is playing music.

HEAVY_WEIGHT_APP: RAM heavy apps that are not being interacted with, but will be a pain to load if its information is cleared in the memory.

SECONDARY_SERVER: App that acts as a secondary server. Not sure what this really means, but client-server thingy but secondary? Could be something that syncs with an app, but is not syncing currently?

BACKUP_APP: App that is currently making a backup (like Titanium backup?)

HOME_APP: Your launcher.

HIDDEN_APP: An exited app that still significant residual memory in the RAM. Exited only some time ago, or is constantly used by the user.

EMPTY_APP: An exited app that only has small remnants of residual memory in RAM. App that is exited quite some time ago.

*NOTE I don’t really understand OOM Groupings. This is what I learned from the link in the description above.

HEREis Gustavo RD78′s thread that users could follow up on OOM Groupings

Want some more about OOMs? Tell me !

Guides/Explanation that uses Apps

 
-SOON

Guides/Explanation that uses Scripts

 
Delayed. basically will be reviewing each script available. Will start from this forum’s scripts wink Governors, I/O Schedulers, Optimization Tips for Android devs be ready to think more on describing you scripts biggrin Governors, I/O Schedulers, Optimization Tips for Android
.BTW, here’s The List of Scripts

BONUS!

Quote:
Manner lessons.
Click the THANKS button whenever somebody helped you.
Also click THANKS to modders and themers and devs. It is understandable that not everybody could donate but clicking a THANKS might also make thier day. They are also humans though. If you were the modder / themer / dev, would you hope people thank you when they’re enjoying your work ? YES!
so be respectful to anyone that work tirelessly to provide you with thier ROM, Script, Mods, Themes, etc..
and Click Thanks to them.

Would I like a Thanks ? YES OF COURSE smile Governors, I/O Schedulers, Optimization Tips for Android

Credits
pikachu01
droidphile
Knight47
Wiki
Google
kokzhanjia biggrin Governors, I/O Schedulers, Optimization Tips for Android

 

Source: XDA

Incoming search terms:

Filed in: Android Tutorials Tags: Android Optimization Tips, Brazilianwax, Governors, I/O Schedulers, Lagfree, Noop, ondemand, Optimization Tips for Android, Performance, powersave, scary, smartass, userspace

You might like:

Riptide GP2 APK Download Riptide GP2 APK Download
GotchaWarriors v3.4 APK Download GotchaWarriors v3.4 APK Download
Nexus Revamped Live Wallpaper APK Download Nexus Revamped Live Wallpaper APK Download
Galaxy S4 Leaf Live Wallpaper v1.0.1 APK Download Galaxy S4 Leaf Live Wallpaper v1.0.1 APK Download
© 2014 Store Android Apps. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.