Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,275 Members 43,098 Now Online
XDA Developers Android and Mobile Development Forum

[REF] CPU Governors and I/O Schedulers

Tip us?
bedalus Old
(Last edited by bedalus; 20th February 2012 at 09:47 PM.)
#1  
Guest
Thanks Meter 0
Posts: n/a
Default [REF] CPU Governors and I/O Schedulers

Spreadsheets for CPU Governors and I/O Schedulers
GOVERNOR RESULTS

I/O SCHEDULERS

Summary of the Results

This is a summary of the six most commonly used governors, listed in order of performance.

Best Performing
#1 - Performance
--- : Use Noop or Deadline
--- : Uses a lot more battery

#2 - SmartassV2
--- : Use Noop or SIO
--- : Good choice if you use a lot of CPU intensive apps

#3 - LulzactiveV2
--- : Use Deadline or Noop
--- : Good choice if you use a lot of CPU intensive apps
--- : Uses a little more battery than SmartassV2

#4 - Lazy
--- : Use Deadline or CFQ
--- : Do not enable SOMF (Screen Off Max Frequency uses more battery)
--- : Good choice if you do not use CPU intensive apps

#5 - Ondemand
--- : Use Noop or Deadline
--- : Good choice if you do not use CPU intensive apps
--- : Saves slightly more battery than Lazy

#6 - Conservative
--- : Use CFQ or Noop
--- : Generally one of the worst governors for saving battery, see next post for why.

Check my summary in the Battery Drain thread for more info about how to save battery.

Where did the other benchmarks go?

All ICS ROM Benchmarks: this thread

Kernel Features and Benchmarks: this thread

Battery drain: this thread

Power Saving Governors: this thread

Thanks to all the developers.
The Following 52 Users Say Thank You to For This Useful Post: [ Click to Expand ]
bedalus Old
(Last edited by bedalus; 20th February 2012 at 08:48 PM.)
#2  
Guest
Thanks Meter 0
Posts: n/a
Conservative Not Saving Power?
Quote:
Originally Posted by chickelnoodensoup View Post
Is the summary in the first post correct with regard to conservative? Is it really "Generally one of the worst governors for saving battery"? Interesting.
I know it seems a little odd. It's because a lot of developers seem to have tweaked conservative to make it feel snappier, but it has resulted in more CPU time at the top frequency.

If you take a look at my new spreadsheet: http://goo.gl/ThVzX

...you can see conservative always uses more power when the screen is on (at least for the four kernels I tested).

There is just one exception where conservative saves more power than other governors, and that is when the screen is off, music is on, deep idle is on, and this only applies specifically to Air Kernel. PLEASE NOTE: Steve Garon does not include deep idle, but is working on it, neither does Eugene, but I've asked him to consider it. For these two kernels, if you are listening to music with the screen off, currently, the best power saving governor is Ondemand.

For people who don't use their phone while off, and don't use many intensive apps, Ondemand is the best power saving choice.

For people who use a lot of CPU intensive apps, SmartassV2 will be the better choice. It will scale more agressively, help prevent lags, and save energy being wasted through these delays.

If you listen to music with the screen off, and your kernel supplies deep idle, the best power saving governor is SmartassV2 (except for the case of Air Kernel, see above). This is because it keeps the CPU close to the most efficient frequency: 400MHz.

I hope that covers anything. If I've made any glaring errors in my reasoning, please let me know.

Choosing a Governor
Variety is the spice of life, so try them all! While Mathkid95 swears by Ondemand, developers Eugene373, morfic, and steve.garon all vetted this work and agreed that the highest performing CPU governor is likely to offer battery savings through the race-to-idle principal. Eugene added that finding the right I/O scheduler to combine with your governor will make a big difference too. Extra thanks to Steve for providing the kernel on which I based this test, and all his valuable input! The I/O scheduler for the test was cfq, and note: governors have settable parameters which may vary between developers.

Choosing a Scheduler
I/O schedulers perform differently depending on the governor you are using. I've investigated this using the six most popular CPU governors (vote here) vs the six available I/O schedulers in Eugene's kernel, and the four available in r_data's kernel. All governors are based on either ondemand, interactive, or conservative. Recommended reading is available here: schedulers also for governors

Schedulers tested against these popular governors:
SmartassV2 - interactive variant, and winner of the governor test.
LulzactiveV2 - interactive variant
Lazy - Ezekeel's governor, ondemand variant
Performance - included as a reference for high scores
Ondemand
Conservative
The Following 11 Users Say Thank You to For This Useful Post: [ Click to Expand ]
bedalus Old
(Last edited by bedalus; 3rd February 2012 at 10:10 AM.)
#3  
Guest
Thanks Meter 0
Posts: n/a
Testing Methodology
To test the kernels I want a fair environment, so any differences in the results are down to the kernel, and nothing else. To achieve this I first make sure I have a clean system:
1) Format /system and /cache and wipe dalvic
2) Install the ROM, install the kernel
3) Boot up, use nstools to select deadline for I/O scheduler
4) Then select a CPU governor and I/O scheduler depending on the test at hand
5) Titanium Backup to restore all my benchmark programs (app only). Set everything to off, no gps, no sync, no BT, airplane mode. Force GPU rendering is selected. Wifi is on for connecting to the benchmark servers. A power adaptor is in use so the battery is always full.

Then I begin testing.

For the CPU Governor Comparison study:
6) Power off and power back up. When lock screen arrives, wait one minute to settle the system, i.e. until screen auto-off. Count to three. Unlock, and begin testing, recording all scores. Start over with all the tests. Record those scores. (I now have two sets of scores for all the benchmarks to create a mean for improved accuracy). Then select next governor, power off and on, and start the cycle again.

For the I/O Scheduler Comparison study:
6) Power off and power back up. For each new scheduler I completed one test which I did not record, just to ensure that the program was properly cached in the system. I then recorded the subsequent ten results. After ten results, I would select the next scheduler, until I had finished all six, then I would also select the next governor and go back to the first scheduler. I repeated this cycle until I had collected data for performance, and the three other main governor types.

Statistics in the scheduler study are a little different to the other tests. They combine overall performance scores with overall variance scores (where lower is better). The formula is

a= Database IO score - 3 standard deviations
b= Write speed - 3 standard deviations
c= Read speed - 3 standard deviations
score=(a*b*c) to the power of 1/3

If you multiply three values together, and take the cube root (same as raising to 1/3) then you arrive at the geometric mean. This type of mean allows the comparison of two different schedulers based not just on their performance, but also how consistent in that performance they are. That score is then compensated by adjusting by half of the percentage discrepancy between the mean and median. For most scores that is an adjustment of less than 1%.
The Following 10 Users Say Thank You to For This Useful Post: [ Click to Expand ]
bedalus Old
(Last edited by bedalus; 3rd February 2012 at 01:05 PM.)
#4  
Guest
Thanks Meter 0
Posts: n/a
Summary of the Results

SmartassV2 won the governor benchmarks, and also performed well in the battery drain benchmarks.

The best I/O scheduler to combine with this is noop.

This is the combination I personally prefer. However, this is merely my opinion, based on my tests. Mathkid95 prefers ondemand. At the time of writing, Steve Garon and Franco prefer their own tweaked versions of conservative. (My tests indicate CFQ is the best match for conservative.)
The Following 22 Users Say Thank You to For This Useful Post: [ Click to Expand ]
 
shockem
Old
#5  
shockem's Avatar
Recognized Developer
Thanks Meter 339
Posts: 1,330
Join Date: Sep 2010
Location: Singapore

 
DONATE TO ME
Nice work on this!
Current Phone: Google Nexus 4
Previous Phones: Samsung Galaxy Nexus, Google Nexus S, HTC HD2, HTC Desire, iPhone 4, iPhone 3GS, iPhone 3G, etc.

Add me to your circles on Google+

Follow me on Twitter @vevekkk
The Following User Says Thank You to shockem For This Useful Post: [ Click to Expand ]
 
marfillaster
Old
#6  
Member
Thanks Meter 10
Posts: 62
Join Date: Nov 2011
Quote:
Originally Posted by bedalus View Post
Summary of the Results

SmartassV2 won the governor benchmarks, and also performed well in the battery drain benchmarks.

The best I/O scheduler to combine with this is noop.

This is the combination I personally prefer. However, this is merely my opinion, based on my tests. Mathkid95 prefers ondemand. At the time of writing, Steve Garon and Franco prefer their own tweaked versions of conservative. (My tests indicate CFQ is the best match for conservative.)
Im also prefer smartassv2+noop. Really good combination
The Following 2 Users Say Thank You to marfillaster For This Useful Post: [ Click to Expand ]
 
Surnom
Old
#7  
Junior Member
Thanks Meter 1
Posts: 20
Join Date: Nov 2010
Location: Montreal
Very usefull, Thanks
bedalus Old
#8  
Guest
Thanks Meter 0
Posts: n/a
Quote:
Originally Posted by Surnom View Post
Very usefull, Thanks
No problem. If anyone is wondering why so few posts, it's because I recently separated this work away from my kernel benchmarking thread. Feel free to feedback.
 
doc_v15
Old
#9  
doc_v15's Avatar
Senior Member
Thanks Meter 98
Posts: 837
Join Date: Oct 2010
Quote:
Originally Posted by bedalus View Post
Summary of the Results

SmartassV2 won the governor benchmarks, and also performed well in the battery drain benchmarks.

The best I/O scheduler to combine with this is noop.

This is the combination I personally prefer. However, this is merely my opinion, based on my tests. Mathkid95 prefers ondemand. At the time of writing, Steve Garon and Franco prefer their own tweaked versions of conservative. (My tests indicate CFQ is the best match for conservative.)
Never kneww that SmartassV2 works best with noop! I used to have it with deadline. Now experiencing the best experience ever!
using Franco BFS Nov 1st

Thanks man! Thanks Franco!
The Following 2 Users Say Thank You to doc_v15 For This Useful Post: [ Click to Expand ]
 
J_Caselles
Old
#10  
Member
Thanks Meter 12
Posts: 55
Join Date: Feb 2012
SmartassV2/Noop +1

The Following User Says Thank You to J_Caselles For This Useful Post: [ Click to Expand ]
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes