[REF] CPU Governors and I/O Schedulers

Status
Not open for further replies.
Search This thread
B

bedalus

Guest
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.
 
Last edited:
B

bedalus

Guest
Conservative Not Saving Power?
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
 
Last edited:
B

bedalus

Guest
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%.
 
Last edited:
B

bedalus

Guest
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.)
 
Last edited:

marfillaster

Senior Member
Nov 27, 2011
73
12
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
 
  • Like
Reactions: syntax_gosong

doc_v15

Senior Member
Oct 15, 2010
1,181
207
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!
 
  • Like
Reactions: d14b0ll0s
B

bedalus

Guest
UPDATE: Steve had a rethink of his Conservative governor parameters, and I've updated the table to include this. Check column L.

Lower scores are natural with conservative. This time, with the new parameters, the scores are even lower. This indicates that the new conservative is throttling the frequencies more aggressively, but it should also be noted that this governor feels much more responsive than the previous incarnation.

Note - the IO score shows a great improvement, but this is due only to a boost in database IO through the recent FSYNC patch. Make sure you use stable voltages to avoid reboots and potential data loss. (No benefit to UV anyway - check the results of my battery study, see link above.)
 

dabado

Senior Member
Dec 23, 2011
87
10
motherwell
Some serious work been put into this.. Anyway of listing governors in respect of there performance then a list of governors for best battery life and the recommended I/O schedulers to accompany them. I know the graph is there but it'll be easier for people like me (not so good with cpu settings) to just simply apply from a high to low list which indicates best performance or more battery life. I'm getting great battery life and decent performance using ondemand with noop but it eats battery a lot more when phone is in use compared to other combinations I've tried.

Sent from my HTC Desire S using XDA App
 
B

bedalus

Guest
Some serious work been put into this.. Anyway of listing governors in respect of there performance then a list of governors for best battery life and the recommended I/O schedulers to accompany them. I know the graph is there but it'll be easier for people like me (not so good with cpu settings) to just simply apply from a high to low list which indicates best performance or more battery life. I'm getting great battery life and decent performance using ondemand with noop but it eats battery a lot more when phone is in use compared to other combinations I've tried.

Sent from my HTC Desire S using XDA App

Good idea. I will try to do it today.

kernels ; battery ; ROM ; gov/sched
 

PatchouliNim

Member
Jan 24, 2012
28
2
Tongyeong
Thaks to your recommend, I use noop + SmartassV2. :D

I used cfq+tweaked conservative before that set, but I can't feel differece and battery life:) (I don't know this phrase mean but I'm saying it is very good!) :p
 
B

bedalus

Guest
UPDATE: First post edited. Now summarises all findings. Also, makes it easier to read if you are using the XDA app
 

glennkaonang

Senior Member
Feb 6, 2012
509
147
Surabaya
Bedalus, I did a little amateur test today.
I played some music with not-too-loud volume.
I keep my data ON, everything else is off.
The screen is always ON with lowest brightness because I'm looking at the CPU frequency used.
CPU min 200, max 1000.
I went to Processor settings and look at the CPU frequency used at the moment.

When I selected Conservative and let it stay for 10 seconds, the CPU freq is showing 1000 constant.
Then I selected Lazy and let it stay for another 10 seconds, the CPU freq is 400 constant.
With SmartassV2, let it stay for 10 seconds, the CPU freq is randomly jumping from 200, 400 and sometimes 1000.

Well my question is, shouldn't Conservative be constantly using the lowest frequency among the other governors?
From what I saw it is Lazy which constantly used the lowest.
What do you think?
I know this test is not reliable at all, so sorry if it's just a waste of time.
 
B

bedalus

Guest
Bedalus, I did a little amateur test today.
I played some music with not-too-loud volume.
I keep my data ON, everything else is off.
The screen is always ON with lowest brightness because I'm looking at the CPU frequency used.
CPU min 200, max 1000.
I went to Processor settings and look at the CPU frequency used at the moment.

When I selected Conservative and let it stay for 10 seconds, the CPU freq is showing 1000 constant.
Then I selected Lazy and let it stay for another 10 seconds, the CPU freq is 400 constant.
With SmartassV2, let it stay for 10 seconds, the CPU freq is randomly jumping from 200, 400 and sometimes 1000.

Well my question is, shouldn't Conservative be constantly using the lowest frequency among the other governors?
From what I saw it is Lazy which constantly used the lowest.
What do you think?
I know this test is not reliable at all, so sorry if it's just a waste of time.

It sounds like quite an interesting test. I'm surprised at the conservative result. Which kernel are you on?
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Nice work on this! :)
    1
    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
    1
    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!