[LG Revolution] spc_hicks09:
Ok guys, this is going to be a long post but I think in the end, it will put a lot of good information to everyone to help them understand kernels a little better. I may not have a machine to be able to develop but I do know quite a bit of stuff lol. Anyway, here's a thread to inform everyone about the different sections of kernels.

First I would like to give some "thanks."

mtmichaelson - for giving us this badass 1.9gHz kernel to play with and for doing soooooo much for development! We are forever in your debt.

droidphile - for teaching me just about everything I know.

*I'm sure there are more people and if I missed you, let me know!*

First, let's start with "governors."

OnDemand:

The default governor in almost all stock kernels. One main goal of the ondemand governor is to switch to max frequency as soon as CPU activity is detected to ensure the responsiveness of the system. Effectively, it uses the CPU busy time as the answer to the "how critical is performance right now" question. So Ondemand jumps to maximum frequency when CPU is busy and decreases the frequency gradually when CPU is less loaded/apporaching idle. Even though many of us consider this a reliable governor, it falls short on battery saving and performance on default settings. One potential reason for ondemand governor being not very power efficient is that the governor decides the next target frequency by instant requirement during sampling interval. The instant requirement can respond quickly to workload change, but it does not usually reflect workload real CPU usage requirement in a longer time and it possibly causes frequent changes between highest and lowest frequency.

Conservative:

A slower Ondemand which scales up slowly to save battery. The conservative governor is based on the ondemand governor. It functions like the Ondemand governor by dynamically adjusting frequencies based on processor utilization. However, the conservative governor increases and decreases CPU speed more gradually. Simply put, this governor increases the frequency step by step on CPU load and jumps to lowest frequency on CPU idle. Conservative governor aims to dynamically adjust the CPU frequency to current utilization, without jumping to max frequency. The sampling_down_factor value acts as a negative multiplier of sampling_rate to reduce the frequency that the scheduler samples the CPU utilization. For example, if sampling_rate was equal to 20,000 and sampling_down_factor is 2, the governor samples the CPU utilization every 40,000 microseconds.

Smartass2:

Version 2 of the original smartass governor from Erasmux. Another favorite for many people. The governor aims for an "ideal frequency", and ramps 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.

Userspace:

Instead of automatically determining frequencies, it lets the user set the frequencies.

Powersave:

Locks max frequency to min frequency. Can not be used as a screen-on or even screen-off (if scaling min frequency is too low).

Performance:

Sets min frequency as max frequency. Very useful while benchmarking!

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.

Now for the "schedulers."

Noop:

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 (yes, like a flash drive). Advantage here is that flash drives do not require reordering of multiple I/O requests unlike in normal hard drives.

*Advantages*​

1. Serves I/O requests with least number of cpu cycles. (Battery friendly?)

2. Best for flash drives since there is no seeking penalty.

3. Good throughput on db systems.

*Disadvantages*​

1. Reduction in number of cpu cycles used is proportionate to drop in performance.

Deadline:

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*​

1. Nearly a real time scheduler.

2. Excels in reducing latency of any given single I/O.

3. Best scheduler for database access and queries.

4. Bandwidth requirement of a process - what percentage of CPU it needs, is easily calculated.

5. Like noop, a good scheduler for solid state/flash drives.

*Disadvantages*​

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

CFQ:

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.

*Advantages*​

1. Considered to deliver a better balanced i/o performance.

2. Easiest to tune.

3. Excels on multiprocessor systems.

4. Best database system performance after deadline.

*Disadvantages*​

1. Some users report that media scanning takes longer 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.

2. Jitter (worst-case-delay) exhibited can sometimes be high, because of the number of tasks competing for the disk.

SIO:

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*​

1. Simple, very very reliable.

2. Minimized starvation of requests.

*Disadvantages*​

1. Slow random-read speeds on flash drives, compared to other schedulers.

2. Sequential-read speeds on flash drives also not so good.

============================================================

That's about all I have for now lol. If I can think of anymore stuff to post on here, I'll get it as soon as I get a chance. Thanks for reading!