[GUIDE] I/O Scheduler's Explained - G 2014 General

I/O SCHEDULERS
Thnx to @droidphile for clearing the concepts.
Here each & every concept of I/O Sched. is very clearly explained.
After reading the post i can assure u that will have sufficient knowledge about I/O Schedulers & u will be able to choose I/O schedulers easily which suits ur needs & and the phone best depending upon the type of work load u put on ur Android Smartphone.
Q. "What purposes does an i/o scheduler serve?"
A. Minimize hard disk seek latency.
Prioritize I/O requests from processes.
Allocate disk bandwidth for running processes.
Guarantee that certain requests will be served before a deadline.
So in the simplest of simplest form: Kernel controls the disk access using I/O Scheduler.
Q. "What goals every I/O scheduler tries to balance?"
A. Fairness (let every process have its share of the access to disk)
Performance (try to serve requests close to current disk head position first, because seeking there is fastest)
Real-time (guarantee that a request is serviced in a given time)
Description, advantages, disadvantages of each I/O Scheduler?
List of I/O Schedulers:-
1) Noop
2) Deadline
3) CFQ
4) BFQ
5) SIO
6) V(R)
7) Anticipatory
1) 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 our flash drives).
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.
2) 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:
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.
3) 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.
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.
4) BFQ
Instead 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.
5) SIO
Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests.
No priority queues 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.
6) V(R)
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.
7) Anticipatory
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.
Frequently asked questions
Q. "Best I/O Scheduler?"
A. There is nothing called "best" i/o scheduler. Depending
on your usage environment and tasks/apps been run,
use different schedulers. That's the best i can suggest.
However, considering the overall performance, battery,
reliability and low latency, it is believed that
SIO > Noop > Deadline > VR > BFQ > CFQ, given all
schedulers are tweaked and the storage used is a flash
device.
Q. "How do i change I/O schedulers?"
A.Voltage Control or No Frills from market.
Or init.d script:
echo "scheduler-name" > /sys/block/mmcblk0/queue/
scheduler
------------------------------------++END++---------------------------------------
Press Thanks :thumbup: If I Helped U

Very useful information [emoji106]

u forgot the default scheduler of g2... Row..

Varun hellboy said:
u forgot the default scheduler of g2... Row..
Click to expand...
Click to collapse
Oops I m going to add it and Let u Know .

The inner intricacies and mechanics of digital systems never cease to amaze and excite me, as an engineer. This is what it's all about - beyond the gloss and the polished glass, under the hood, deep down at the transistor & gate level. What an amazing time we are living in
Thank you for posting this, God bless you. Happy Christmas.

Related

CPU Governors explained

Thanks to deedii for posting this in another forum:
http://forum.xda-developers.com/showpost.php?p=26884865&postcount=2
Android CPU governors explained
What is a governor?
A governor is a driver for the regulation of CPUFreq - CPU frequency. As the name suggests, we, the Governor of the decision, when at full capacity, the MaxFreq - will be achieved or how fast the minFreq - - maximum frequency is reached minimum frequency or center frequency. He decides when, how and how long the CPU and still responds battery saving is still soft and still works.
There are many types of governors. Some are for single-core processors and some designed for dual-core processors. In stock kernel, there are five governors and quasar kernel, there are a lot more.
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: Wheatley
23: Lulzactive
24: AbyssPlug
25. BadAss
26. Ktoonservative
27. AssWax
28. Sleepy
29. Hyper
30. Zen
31. Dyninteractive
32. SmartassH3
33. Smartmax
34. Pegasusq
35. Nightmare
36. Darkness
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 scales CPU frequency based on load, similar to “ondemand”. It scales up to the highest frequency when “up_threshold” is crossed and scales down one frequency at a time when “down_threshold” is crossed. Unlike those governors, target frequencies are determined by directly accessing the CPUfreq frequency table, instead of taking some percentage of maximum available frequency.
The key difference in the “hotplug” governor is that it will disable auxillary CPUs when the system is very idle, and enable them again once the system becomes busy. This is achieved by averaging load over multiple sampling periods; if CPUs were online or offlined based on a single sampling period then thrashing will occur.
Sysfs entries exist for “hotplug_in_sampling_periods” and for “hotplug_out_sampling_periods” which determine how many consecutive periods get averaged to determine if auxillery CPUs should be onlined or offlined. Defaults are 5 periods and 20 periods respectively. Otherwise the standard sysfs entries you might find for “ondemand” and “conservative” governors are there.
Obviously, this governor is only available on multi-core devices.
22: Wheatley
in short words this govenor is build on “ondemand” but increases the C4 state time of the CPU and doing so trying to save juice.
23: Basically interactive governor with added smartass bits and variable (as opposed to fixed amout) frequency scaling, based on currently occuring cpu loads. Has, like smartass, a sleep profile built-in. See link for details on exact scaling.
24: Abyssplug governor is a modified hotplug governor.
25. 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.
26, Ktonnservative
Ondemand scales to the highest frequency as soon as a load occurs. Conservative scales upward based on the frequency step variable which means for the most part will scale through every frequency to achieve the target load thresholds. What this practically means is ondemand is prone to wasting power on unneeded clock cycles. Ondemand also features something called a down differential, this variable determines how long the governor will remain at the given frequency before scaling down. Conservative does not have this, but instead relies on having a down threshold which insures that as soon as the load drops below a given variable it scales down as fast as the sampling rate allows. The result to this is a governor which attempts to keep the load level tolerable and save you battery! Now ! Ktoonservative Is that but in addition contains a hotpluging variable which determines when the second core comes online. The governor shuts the core off when it returns to the second lowest frequency thus giving us a handle on the second performance factor in our CPUs behavior. While by default conservative is a poor performer it can be made to perform comparably to even performance governor. Here are some settings to discuss and start with. They are slightly less battery friendly under a load but very very well performing.
27. AssWax
So far, all I have found about this Governor is that it belongs in the interactive family. I'll update this when I find more
28. Sleepy
The Sleepy (formerly known as Solo) is an attempt to strike a balance between performance and battery power to create. It is based on the getweakten Ondemand of Arighi and is optimized for the SGS2. It may include imoseyon's Ondemandx with some tweaks Down_sampling and other features that set by the user through the sysfs of "echo" call. Sleepy is the behavior of Ondemandx when he is in action, very similar.
29. Hyper
The Hyper (formerly known as kenobi) is an aggressive smart and smooth, optimized for SGS2 getweakt and, based on the Ondemand, which was getweakt of Arighi and was equipped with several features of Ondemandx suspend imoseyon. (Added by sysfs, the settings suspend_freq and suspend Imoseyon's code) is the behavior of the hyper Ondemand if he is in action, very similar. He also has the Arighi's fast_start deep_sleep and detection features. In addition, the maximum frequency is in suspend mode 500Mhz.
30. Zen
Well, the question that was asked above led me to an analysis of V(R ), deadline, and some others. I already knew, but realized "this is the main feature of V(R), but wait it has no benefit to us smartphone users." So I thought about adjusting the way V(R ) handled requests and how it dispatched them (I chose V(R ) because i'd rather not tinker with a scheduler thats official and widely supported). Then I was looking over it, and realized I might as well just write a new one I don't need any of this stuff. So I came up with something awfully similar to SIO, although its a bit simpler than SIO (closer to no-op) and works just slightly different.
- It's an FCFS (First come, first serve) based algorithm. It's not strictly FIFO. It does not do any sorting. It uses deadlines for fairness, and treats synchronous requests with priority over asynchronous ones. Other than that, pretty much the same as no-op. (Credit bbedward http://forum.xda-developers.com/showthread.php?p=33327389)
31. Dyninteractive
All I can find about this governor is that the DynInteractive seems to behave perfectly in terms of frequency ramping so far and keeps the system running mostly on low clock speeds, unless really needed (games, heavy browsing, etc).
32. SmartassH3
The SmartassH3 governor is designed for battery saving and not pushing the phones performance, since doing that drains battery and that's the one thing people keep asking for more of.
33. Smartmax
This is a new governor which is a mix between ondemand and smartass2 By default this is configured for battery save - so this is NOT a gamer governor! This is still WIP!
34. Pegasusq
Read This: Pegasusq Governor
35. 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.
36. Darkness
It's based on nightmare but more simple and fast, basic configs but very complex structure. * Alucard updated nightmare gov and improved stability, so far what stable in tests
Credits goes to:
http://icrontic.com/discussion/95140/android-cpu-governors-and-you-setcpu-system-tuner-tegrak
http://forum.xda-developers.com/showthread.php?t=1369817
What is a scheduler?
In a multitasking operating system, there must be an instance, the processes that want to run, CPU time and allocates it "goes to sleep" after the allotted time (timeslice) again. This instance is called the scheduler, such as opening and closing applications. that is, how fast they are open and how long they are kept in RAM.
I / O scheduler can have many purposes like:
To minimize time searching on the hard disk
Set priorities for specific process requests
To regulate a particular portion of the bandwidth of the data carrier to each running process
To guarantee certain process requests within a certain time
Which scheduler are available?
CFQ
Deadline
VR
Simple
Noop
Anticipatory
BFQ
Sio
Row
Anticipatory:
Two important things here are indicative of that event:
- Looking on the flash drive is very slow from Equip
- Write operations while at any time are processed, however, be read operations preferred, ie, this scheduler returns the read operations a higher priority than the write operations.
Benefits:
- Requests of read accesses are never treated secondarily, that has equally good reading performance on flash drives like the noop
Disadvantages:
- Requests from process operations are not always available
- Reduced write performance on high-performance hard drives
CFQ:
The CFQ - Completely Fair Queuing - similar to the Dead Line maintains a scalable continuous Prozess-I/O-Warteschlange, ie the available I / O bandwidth tried fairly and evenly to all I / O requests to distribute. He created a statistics between blocks and processes. With these statistics it can "guess" when the next block is requested by what process, ie each process queue contains requests of synchronous processes, which in turn is dependent upon the priority of the original process. There is a V2 and the CFQ has some fixes, such as were the I / O request, hunger, and some small search backward integrated to improve the responsiveness.
Benefits:
- Has the goal of a balanced I / O performance to deliver
- The easiest way to set
- Excellent on multiprocessor systems
- Best performance of the database after the deadline
Disadvantages:
- Some reported user that the media scanning would take this very very long time and this by the very fair and even distribution of bandwidth on the I / O operations during the boot process is conditioned with the media scanning is not necessarily the highest should have priority
- Jitter (worst case delay) can sometimes be very high because the number of competing with each other process tasks
Deadline:
This scheduler has the goal of reducing I / O wait time of a process of inquiry. This is done using the block numbers of the data on the drive. This also blocks an outlying block numbers are processed, each request receives a maximum delivery time. This is in addition to the Governor BFQ very popular and in many well known kernels, such as the Nexus S Netarchy. He was indeed better than the BFQ, but compared to the VR he will be weaker.
Benefits:
- Is nearly a real-time scheduler.
- Characterized by reducing the waiting time of each process from - best scheduler for database access and queries.
- Bandwidth requirements of a process, eg what percentage does a CPU is easy to calculate.
- As the Governor-noop ideal for flash drives
Disadvantages:
- If the system is overloaded, can go a lost set of processes, and is not as easy to predict
SIO:
It aims to achieve with minimal effort at a low latency I / O requests. Not a priority to put in queue, instead simply merge the requests. This scheduler is a mix between the noop and deadline. With him there is no conversion or sorting of requests.
Benefits:
- It is simple and stable. - Minimized Starvations (starvation) for inquiries
Disadvantages:
- Slow random write speeds on flash drives as opposed to other schedulers. - Sequential read speeds on flash drives, not as good
Noop:
The noop scheduler is the simplest of them. He is best suited for storage devices that are not subject to mechanical movements, such as our flash drives in our SGSII's to use to access the data. The advantage is that flash drives do not require rearrangement of the I / O requests, unlike normal hard drives. ie the data that come first are written first. He's basically not a real scheduler, as it leaves the scheduling of the hardware.
Benefits:
- Adds all incoming I / O requests in a first-come-who-first-served queue and implements requests with the fewest number of CPU cycles, so also battery friendly
- Is suitable for flash drives because there is no search errors
- Good data throughput on db systems
Disadvantages:
- Reducing the number of CPU cycles corresponds to a simultaneous decline in performance einhergehendem
VR:
Unlike other scheduling software, synchronous and asynchronous requests are not handled separately, but it will impose a fair and balanced within this deadline requests, that the next request to be served is a function of distance from the last request. The VR is a very good scheduler with elements of the deadline scheduler. He will probably be the best for MTD Android devices. He is the one who can make the most of the benchmark points, but he is also an unstable schedulers, because his performance falter. Sometimes they fluctuate below the average, sometimes it fluctuates above the average, but if above, then he is the best.
Benefits:
- Is the best scheduler for benchmarks
Disadvantages:
- Performance variability can lead to different results
- Very often unstable or unzverlässig
Simple:
As the name suggests, it is more of a simple or simple scheduler. Especially suitable for EMMC devices. He is reliable, maybe not as good as the VR, when this time has a good day, but he is despite all this very performance-based and does his best. At the moment it is the default scheduler in quasar kernel.
Advantages: - not known
Cons: - not known
BFQ:
Instead requests divided into time segments as the CFQ has, on the BFQ budget. The flash drive will be granted an active process until it has exhausted its budget (number of sectors on the flash drive). The awards BFQ high budget does not read tasks.
Benefits:
- Has a very good USB data transfer rate.
- Be the best scheduler for playback of HD video recording and video streaming (due to less jitter than CFQ Scheduler, and others)
- Regarded as a very precise working Scheduler
- Delivers 30% more throughput than CFQ
Disadvantages:
- Not the best scheduler for benchmarks - higher budgets that were allocated to a process that can affect the interactivity and bring with it increased latency.
Row:
Q: What is the ROW I/O scheduler?
A: ROW stands for "READ Over WRITE"
The ROW IO scheduler was developed with the mobile devices needs in
mind. In mobile devices we favor user experience upon everything else,
thus we want to give READ IO requests as much priority as possible.
In mobile devices we won’t have AS much parallel threads as on desktops.
Usually it’s a single thread or at most 2 simultaneous working threads
for read & write. Favoring READ requests over WRITEs decreases the READ
latency greatly.
How can I change the governor and scheduler?
There are two ways to change the governor and schedulers, as well as the settings for the Governorn. Either manually, in which you use a file manager like Root Explorer and then knows how to / sys / devices / system and then change the files to his wishes, provided you what you're doing, or via a graphical interface or by phone as SetCPU Voltage Control. These are the most prominent apps when it comes to adjusting the governor and / or scheduler.
- SetCPU are, besides the possibility of the clock speed of the CPU, setting profiles in certain situations, only to change the way the governor. The scheduler can not change it.
- Voltage control can alter both the governor and the scheduler, but has no way to adjust behavior profiles. While you can set various overclocking, Governor and scheduler profiles manually, but nothing more. Nevertheless, I prefer the VC, since it is simple and gives me the opportunity to change the scheduler.
Credit goes to [url="http://tinzdroid.blogspot.com/2012/07/android-kernel-governors-modules-io.html]Tinzdroid[/url]
Damn learn something new today. Bookmark this page....
that dude drives a A-Team van. yeah that's right, I'm working on it. Z.R.T.
hey hip kat which are you running?
SmartassV2.
Seemed like the best mix of performance vs. battery life from what I was reading.
link to Wheatley:
http://forum.xda-developers.com/showpost.php?p=21864389&postcount=75
link to lulzactive:
http://tegrak2x.blogspot.com/2011/11/lulzactive-governor-v2.html
good reading hipkat..... thanks for the info
Nice info, thx mate
This was really helpful, thanks!
Dude thank you for this writeup. Extremely helpful. OndemandX works great on Sense ROMs IMO
Thanks for the info .
I'm gonna sticky this as the info is great to have for users. The only thing I ask is that along with credits you attach a link to the original thread please.
xda moderator/recognized contributer
Thank you, Papa!!!
I'll go look for it and get the link in here asap
I'll update it, too, as I learn about the newer governors that come out, etc.
thanks for the info
Thanks, now how about schedulers noop or bfq
jasonwojo75 said:
Thanks, now how about schedulers noop or bfq
Click to expand...
Click to collapse
Good idea, plus there are newer governors coming out that I need to get added to the OP
Wow man, summed it up pretty damn good. I was curious as to what differences there were between all the governors out there.
Well written and in-depth, this helped my understanding of them a great deal, you are thanked.
Performance Governor
I thought too that running at "Performance" governor was a crazy idea, and I just tried setting it on my HD2 at around 1:10 PM today, little over an hour ago. I'm on NexusHD2-ICS-4.0.4-CM9-HWA V2.3 ( tytung_HWA_r3), BDW. I'm running gmail, Skype and other "push" apps on the background all the time, and WiFI is constant ON.
To my surprise, after looking at SystemPanel history, the battery has been flat for almost an hour! (See screenshot attachment)
So I guess the theory is correct, where the variable bitrate (up/down scaling) consumes more cpu and battery that just runing full speed while processes demand it, and then fast fall time to low power. So fast rise/fast fall seems to be best battery saver and performance.
More tests need to be done, but so far, I hadn't seen my battery consumption this good, with any other governor!
Cheers
I totally agree with that, that scaling up and down puts more of a load on the cpu. Think about a car motor. Idling, vs revving it over and over
Awesome thread! This helps a lot on which gov to use! +1
Nice thread. I personally like SavagedZen. 2nd choice is Wheatley.

IO schedulers

I've done Google searches on io schedulers and there aren't any up to date guides. I am aware of their purpose, but I'm not sure what the differences are. Could someone explain noop/deadline/row/cfq/bfq/sio/fiops/zen/vr? Thank you!
Sent from my VS980 4G using XDA Premium 4 mobile app
Try this:
4. I/O SCHEDULERS
Q. "What purposes does an i/o scheduler serve?"
A.
* Minimize hard disk seek latency.
* Prioritize I/O requests from processes.
* Allocate disk bandwidth for running processes.
* Guarantee that certain requests will be served before a deadline.
So in the simplest of simplest form: Kernel controls the disk access using I/O Scheduler.
Q. "What goals every I/O scheduler tries to balance?"
A. * Fairness (let every process have its share of the access to disk)
* Performance (try to serve requests close to current disk head position first, because seeking there is fastest)
* Real-time (guarantee that a request is serviced in a given time)
Q. "Description, advantages, disadvantages of each I/O Scheduler?"
A.
1) 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 our flash drives). 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.
2) 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:
* 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.
3) 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. 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.
4) BFQ
Instead 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.
5) 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:
* 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.
6) V(R)
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.
I/O Schedulers
Disadvantages:
* Performance fluctuation results in below-average performance at times.
* Least reliable/most unstable.
7) Anticipatory
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.
Q. "Best I/O Scheduler?"
A.There is nothing called "best" i/o scheduler. Depending on your usage environment and tasks/apps been run, use different schedulers. That's the best i can suggest.
However, considering the overall performance, battery, reliability and low latency, it is believed that
SIO > Noop > Deadline > VR > BFQ > CFQ, given all schedulers are tweaked and the storage used is a flash device.
Q. "How do i change I/O schedulers?"
Voltage Control or No Frills from market.
Or init.d script:
echo "scheduler-name" > /sys/block/mmcblk0/queue/scheduler
Info found on this thread:
http://forum.xda-developers.com/showthread.php?p=19846276
Thanks Devs. From my VZW G2.
trickster2369 said:
Try this:
4. I/O SCHEDULERS
Q. "What purposes does an i/o scheduler serve?"
A.
* Minimize hard disk seek latency.
* Prioritize I/O requests from processes.
* Allocate disk bandwidth for running processes.
* Guarantee that certain requests will be served before a deadline.
So in the simplest of simplest form: Kernel controls the disk access using I/O Scheduler.
Q. "What goals every I/O scheduler tries to balance?"
A. * Fairness (let every process have its share of the access to disk)
* Performance (try to serve requests close to current disk head position first, because seeking there is fastest)
* Real-time (guarantee that a request is serviced in a given time)
Q. "Description, advantages, disadvantages of each I/O Scheduler?"
A.
1) 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 our flash drives). 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.
2) 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:
* 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.
3) 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. 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.
4) BFQ
Instead 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.
5) 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:
* 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.
6) V(R)
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.
I/O Schedulers
Disadvantages:
* Performance fluctuation results in below-average performance at times.
* Least reliable/most unstable.
7) Anticipatory
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.
Q. "Best I/O Scheduler?"
A.There is nothing called "best" i/o scheduler. Depending on your usage environment and tasks/apps been run, use different schedulers. That's the best i can suggest.
However, considering the overall performance, battery, reliability and low latency, it is believed that
SIO > Noop > Deadline > VR > BFQ > CFQ, given all schedulers are tweaked and the storage used is a flash device.
Q. "How do i change I/O schedulers?"
Voltage Control or No Frills from market.
Or init.d script:
echo "scheduler-name" > /sys/block/mmcblk0/queue/scheduler
Info found on this thread:
http://forum.xda-developers.com/showthread.php?p=19846276
Thanks Devs. From my VZW G2.
Click to expand...
Click to collapse
Thank you! And what exactly are zen and fiops?
Sent from my VS980 4G using XDA Premium 4 mobile app
iluvandroid6879 said:
Thank you! And what exactly are zen and fiops?
Sent from my VS980 4G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
First off, I am not a guru by any stretch out the imagination. Zen and fiops are just different versions of schedulers. Zen is based off of the conservative scheduler, I believe, with some of its own characteristics added in. Fiops, I'm not sure about, but have seen it offered by different devs in the past. Hope that helps just a little.
Thanks Devs. From my VZW G2.
trickster2369 said:
First off, I am not a guru by any stretch out the imagination. Zen and fiops are just different versions of schedulers. Zen is based off of the conservative scheduler, I believe, with some of its own characteristics added in. Fiops, I'm not sure about, but have seen it offered by different devs in the past. Hope that helps just a little.
Thanks Devs. From my VZW G2.
Click to expand...
Click to collapse
Thank you for your info! its appreciated. Although, isn't conservative a CPU governor not a io scheduler?
Sent from my VS980 4G using XDA Premium 4 mobile app

[Guide] I/O scheduler

If you don’t know what`s an I/O scheduler or want to know the working of each scheduler read this http://forum.xda-developers.com/showpost.php?p=23616564&postcount=4 Thanks to droidphile
Thanks to @KNIGHT97 for his tips and experience http://forum.xda-developers.com/showthread.php?t=2784750 he inspired me to do this
Introduction
Every Scheduler has its advantage and disadvantage, so its difficult to find what suits you. So I have come up with a guide to help those people decide the right I/O scheduler according to their usage.
This guide is from my observation, the information below may or may not be accurate. If the scheduler doesn’t work as well as mentioned below, then maybe your kernel has a different version of the scheduler.
People most often use benchmarking apps to find a good I/O scheduler, but that’s the wrong way to go. First off all the benchmarks results are similar for each scheduler.
Let me tell you how a scheduler can affect your performance
Some scheduler try handling multiple operations at one time (Uses more CPU and battery) while others do few or only one at a time (Use less CPU and saves battery)
Let’s take an example, copying few big files one at time is faster than copying all at once… So at situation like that I/O scheduler that does one at time is good
But when there is multiple small files, the speed is very slow when copying one at a time but copying many at once is faster… So here we can say I/O scheduler that handle multiple operation is better
When I mention light I/O operation, it means the file size is small or if its writing a big file it doesn’t need high speed(like a long non-HD video recording) and as for heavy I/O operation means it’s reading/writing a big file
If an app requests read/write one at a time or does requests multiple,its performance can be affected by the scheduler accordingly
I/O scheduler
CFQ (Completely Fair Queuing)
CFQ it is said to work well with multi core processor and balances both write a read. It handles multiple operations real well but can be slow if most of the operation is read and little write (maybe cause its reserving place for another write operation /?)
Many people say that the media scanning is really, and I agree to it. (I have like 300 apps on my 64GB sandisk microSD and it is overloaded with many big and small files, So… I can easy tell the difference cause it takes like 1:30 minutes before the externalSD apps icon to load while on other scheduler it takes around 30 sec to 1 min
Ideal if you download files a lot and use apps that mainly read files(like music/ videos) or you use apps that needs to read and write equally.
ROW (Read Over Write)
It is just like CFQ but just as the name implies, it gives priority for reading. It also handles multiple operations real well.
Its ideal when you run apps has more read operations and little write
So if you use more multiple reading operations(like gallery). Row is the best scheduler for you
I wanted to use scheduler that does one at time operation but some apps like tumblr does reading and little cache writing at the same time so I use ROW instead for internal storage
BFQ (Budget Fair Queueing)
BFQ is just like CFQ but you could say it’s better for heavy process or lots of multiple process and uses the CPU even more. Due to its high CPU usage when doing lots multiple I/O operations other non-I/O operations can become laggy.
Ideal for burst shots, HD recording and other multiple heavy read and write
Most computers uses BFQ
Noop
Noop is a rather simpler scheduler compared to those above. There is no priority for read or write, it does thing in a first in first out(FIFO) method. So it basically does things one at a time.
Ideal for those that have light usage of the storage and for people who wants to save battery or wants less CPU usage
Many apps don’t require to write and read at the same time so it’s ideal for those apps
Ideal for doing one at a time like only downloading, playing video, music and taking photo or video
Sometimes can be slower than deadline, SIO or zen
Not ideal for some games
Deadline
Its bit similar to noop but handles processes little differently, it creates a queue(FIFO) of around 5 and gives each queue a turn by giving the process a deadline. It handles multiple light I/O operations real well
Ideal for those that have medium usage of the storage
Might suit better than ROW/CFQ for those that who don’t have heavy and multiple I/O operation
It is said that when the CPU is overloaded, set of processes that may miss deadline is largely unpredictable.
SIO
It’s the mix of the Noop and deadline. It’s known for its simplicity of handling I/O request and handles operations one at a time
Ideal for those that have light-medium usage of the storage
Many apps don’t require to write and read at the same time so it’s ideal for those apps
Ideal for doing one at a time like only downloading, playing video, music and taking photo or video
I use SIO for the external storage cause that’s where I keep my Games, Photos, Videos and Music and I naturally cant play music when playing a game or watch a video while listing to music which is ideal for a scheduler that does one at a time operation
Zen
Zen is said to also be simply yet more close to noop. From my observation, It has notably more speed for I/O read and write (this is the one that has noticeable difference in benchmark only ) but uses the CPU a lot if the I/O operation is heavy which can cause more lag than BFQ. It does one at a time operation.
Might be good for games that reads a lot (like graphic data) since its fast. You don’t have to worry about the fact that zen uses a lot of CPU which could make the game lag cause most I/O operation is short and when done it won’t use the CPU until next operation (need to test more)
Ideal for burst shots and HD recording also
Many apps have short/light I/O operation so you wont face lag but an increase in speed compared to SIO or Noop (sometimes faster than others also)
Not ideal for multitasking like browsing and downloading at the same time
VR
It’s said to treat each process fairly by giving them a deadline and has performance fluctuation so sometimes it’s the most fastest scheduler or just plain slow.
Not sure if it handles multiple operations well or one at time operations.... I need to research more
Not sure what it’s ideal for hmm…. Maybe for those that dont have fixed usage
FAQ
When deciding an I/O for each storage, treat the usage separately.eg I listen to music(external with SIO) and use tumblr (internal with ROW) though SIO does things one at time, there won’t be music shuttering. But if my music was on internal with SIO there will be music shuttering
If you too many different uses and cant stay with one I/O scheduler. Use Perfomance profile by h0rn3t. It can change I/O scheduler and other settings depending on the app http://forum.xda-developers.com/xposed/modules/xposed-performance-profile-t2723739
Since most external SDcard has slow speed, I recommend a scheduler that does operations one at a time
As for the battery usage, it doesn’t make much of difference cause usually most I/O operations aren’t that long unless you are downloading or something. Battery usage depends on the CPU usage caused by the scheduler so….
SIO<Noop<Deadline<VR<ROW<=CFQ<Zen<=BFQ
SIO supposedly has least battery usage while Zen and BFQ has the most
And that’s the end of my guide
Do comment and share your opinions or preference
If you find any info incorrect or that I could add, do tell
Reserved
Reserved
Nice info mate,maybe u can add more info for governors,and which scheduler suits with xxx governor. Just a tip,?
Sent from my GT-N7100 using Tapatalk

Ubuntu benchmark & storage scheduler/buffer size

Greetings fellow flashers… much as I´ve tried to UTFSE I haven’t found a clear answer/info to the question in object, so here goes
When I run the standard test on* Ubuntu I can get a quite varied range of results for my phone – from about 15.000 to a shave under 30.000. Unsurprisingly enough, most of the variations in these results come from the CPU governor, settings related hotplug mechanism and the GPU… one group of options I never previously touched were the I/O options (scheduler for internal storage was always on the standard “CFQ” and I also left the read ahead buffer size to its default settings)
Today I decided to give these options a go and here´s where the surprise came: pretty much any option I tried simply trounced my “optimal” results of approx.. 30´ 000 points… I tried a couple of I/O schedulers (I remember sioplus and zen for sure) and as far as the the increasing the to 1024 kb (instead of the standard 128kb for internal and 256 for external)… the effect of changing the scheduler was to reduce the ubuntu score to about 20´000 (best case) and sometimes quite a bit less than that…. So now for the questions:
1. What exactly is the effect of these scheduers & the buffer?
2. Why do these changes in scheduler/buffer size, which have no clear effect
3. Are there optimal settings for these schedulers & buffer size? Does changes in the settings have any consequence on battery life?
*
thanks in advance for all your feedback!
Platypus
Bump - can anyone help ?
The I/O scheduler has to do with reading and writing data, basically. I can't really explain it.
Having a different scheduler can give you better ui responsivness and app opening times. Results vary.
ZEN is said to be better for gaming. FIOPS seems to be the best all-round performer. And bfq is battery friendly.
Increasing the cache size should also benefit. A 2048kb size should be enough.
Don't expect wonders, though.

[A6020] Kernel Tweaks [03/31/2017]

Kernel Tweaks Intended for balanced performance/battery life on actual usage.
Please provide feedback.
Changelog/FAQs
Attention! It assumes that you've already optimized your phone (background apps, idle drain, wakelocks...), which is up to you, and NOT covered on this post.
All sources and credits at the end.
Great thanks to @Dreamstar for the awesome Vegito Kernel!
NOT recommended for gaming, image processing or heavy loads.
Tweaks:
CPU
I/O scheduler
GPU
HMP scheduler (big.Little related)
Virtual Memory
perfd, sched_boost and sched_load disabled to use LITTLE as the main cluster in order to save power
Minimal overheat
Any ROM/Kernel:
http://www6.zippyshare.com/v/PGToHEyx/file.html
does NOT affect hotplug at all, may seem sluggish with incorrect profiles (due to lack of optimization)
does not apply Input Boost
disables Touch Boost (if present)
Kernels with Core Control (core_ctl) hotplug enabled (Lineage OS, AOKP, RR):
Option 1:
http://www103.zippyshare.com/v/WQlpK3en/file.html
Great SoT/Battery Life
May feel sluggish
May contain micro lag/stuttering
2 Little cores always online
big cluster offline most of the time
may have problems with audio crackling during music playback
Option 2:
http://www103.zippyshare.com/v/tz4IiM4n/file.html
Biased towards performance (in case the previous one was behaving bad)
Slightly less battery life
Smooth enough
Little cluster always online
big cluster offline most of the time
Vegito Kernel (RECOMMENDED):
http://www76.zippyshare.com/v/lSXeYI9b/file.html
New*: http://www19.zippyshare.com/v/n9CsRYYk/file.html
*if unstable (e.g. force close), set swappiness to a value between 10~60
Best balance between performance/battery
Snappy
Smooth
Above-average SoT
Thunderplug support
big.LITTLE always online (lower latency and no waste of CPU cycles)
Input boost set at 998Mhz on Little cluster, with duration of 1980ms. (not very battery friendly, try lower values)
Useful links:
The truth about kernels and battery life
Your battery gauge is lying to you (and it's not such a bad thing)
Diving into Doze Mode
Battery Calibration (myth)
Battery Drain Benchmarks
Sources/Credits:
Original GlassFish settings for interactive by @soniCron
Interactive governor battery save scripts by @Sickaxis79
Xiaomi Mi Max Kernel Guide by white778899
LSpeed by @Paget96
[AKT] Advanced Kernel Tweaks by @Asiier, @patalao, @Mostafa Wael and @Senthil360
Changelog 03/31:
Code:
Cleanup:
- Fixed useless loops and condition checks
- Added credits (developers of Project Zhana/Advanced Kernel Tweaks)
- Typos
Vegito only (unstable):
CPU:
- Timer slack cut in half (from 480000) on big Cluster
- Increased 'go_hispeed_load' (91 -> 400 on big, 91 -> 155 on LITTLE)
- Input Boost duration reduced to 120ms (from 1920ms); (drastically improves battery)
- Input Boost frequency increased to 1113MHz (from 998MHz); should not affect battery much, since it stays on the same voltage
GPU
- Revert 'underclock' (465MHz -> 550MHz) to minimize UI lags, trust Adreno Idler to reduce power consumption.
HMP Scheduler:
- Lower 'sched_upmigrate' (90 -> 85)
- 'sched_freq_dec_notify' decreased (410000 -> 400000)
Virtual Memory:
- Increased ZRam to 256MB (from 128MB)
Changelog 03/30:
Code:
HMP Scheduler:
- don't schedule background tasks on big cluster
Virtual Memory - reduce usage of CPU cycles:
- new values from Project X.A.N.A (high dirty_ratio and dirty_background_ratio, min_free at 4M and default vfs_cache_pressure)
IO Scheduler:
- New logic to apply I/O scheduler (from Project X.A.N.A)
- Try ZEN
- if zen is not available use noop (on Lineage OS), otherwise use BFQ.
- increased read-ahead to 512Kb (core_ctl scripts still use 128Kb)
- apply to internal and external memory (SDCard) if present
- changed zen tunables (thanks to [URL=https://forum.xda-developers.com/oneplus-3/how-to/advanced-interactive-governor-tweaks-t3476589][AKT] Advanced Kernel Tweaks[/URL] by [user=6187429]@Asiier[/user] - Project X.A.N.A
Cleanup:
- moved verbose descriptions (now at the end of this post)
- Mhz -> MHz
core_ctl only:
CPU:
- target load set to 499Mhz until 75% (from 70%)
Virtual Memory:
- 20 swappiness and 70 vfs_cache_pressure
- page-cluster set to 0 (read only 1 page from swap each attempt)
- Laptop Mode set to 1
Vegito only (unstable):
HMP Scheduler:
- try to use big cluster more, easing the load of the the LITTLE cluster (from [URL=https://forum.xda-developers.com/showpost.php?p=69417941&postcount=724]Project X.A.N.A[/URL]) (*trying different freq_notify values atm)
- big.LITTLE should not overload a single core or cluster.
CPU:
- align_windows set to 0 (both clusters)
- increased min_sample_time (from 0)
- revert 'fix erratic jump to 998Mhz while idle'
Virtual Memory:
- swap only to avoid out of memory conditions ( vm.swappiness = 0 ) # if unstable (e.g. force close), set to a value between 10~60
- lower ZRam (200MB -> 128MB)
- Laptop Mode disabled
Changelog 03/29:
Code:
Cleanup:
- add simple function to change permissions and apply settings
- typos
Vegito only:
CPU
- fix erratic jump to 998Mhz while idle
--------------------------
FAQs
How to apply (need root):
Apply every boot.
Using Terminal (RECOMMENDED):
Code:
su -c 'sh /script directory/script.sh'
or
su
cd 'script directory/'
sh script.sh
Can be found at Developer Options or you can download one from the Play Store: https://play.google.com/store/apps/details?id=com.termux
Using Kernel Adiutor:
Copy file to /etc/init.d/
Give permissions rwxr-xr-x (0755)
Go to init.d tab on Kernel Adiutor
Execute script.sh
Why do you leave all cores online??11 (vegito)
CertifiedBlyndGuy said:
Thought I would add more to this and make it useful for a few users.
The reason behind why Mpdecision is disabled by default is due to the fact that it is highly inefficient in the sense that hotplugging on Linux, put simply, sucks. Why? The hotplug acts as a front-end to the scheduler to provide a means of plugging and unplugging cores in exchange for a high amount of latency. This means that even though a core may be plugged, there is a delay of several milliseconds before this is actually processed causing microstutters that are hard to notice, but do disrupt performance. The same can be said for the thermal driver and how it Aries frequencies.
Click to expand...
Click to collapse
franciscofranco said:
Leaving all cores online is fine, they'll hit retention and power collapse pretty quickly if nothing is running on them. There's a lot of work when offlining and onlining cores.
Click to expand...
Click to collapse
franciscofranco said:
Hotplug is the action of onlining a core (after it has been unplugged) in a live system, which is present in any Kernel of any device with more than 1 core. You can offline it through sysfs. What you are asking is: if there's any automatic mechanism that onlines & offlines cpu cores based on some special heuristic. The answer is no.
They are online at all times unless there's the need for some thermal throttle. They'll follow the standard Linux resume->suspend mechanism just like any other "normal" phone when the OEM doesn't **** with the natural cycle. This is exactly how the Nexus 6P (same chip) works. I explain it in the changelog & in the feature list. Cores will go to idle in a "jiffy" if they don't have any runnable threads running.
Click to expand...
Click to collapse
From: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/index.html
Code:
15.1.3. Retention
The core state, including the debug settings, is preserved in low-power structures,
enabling the core to be at least partially turned off. Changing from low-power
retention to running operation does not require a reset of the core. The saved
core state is restored on changing from low-power retention state to running
operation. From an operating system point of view, there is no difference between
a retention state and standby state, other than method of entry, latency and use-related constraints.
Check if you Kernel supports the Core Control (core_ctl) hotplug driver:
These folders must be present:
Code:
/sys/devices/system/cpu/cpu0/core_ctl/
/sys/devices/system/cpu/cpu4/core_ctl/
Extreme Kernel (cluster-plug based -> version 12/30 and above)
Try GlassFishCP or FairyTale from https://forum.xda-developers.com/moto-x-play/general/interactive-governor-battery-save-t3443201
Disable Alucard hotplug (to prevent conflicts with cluster-plug)
Disable Simple GPU Algorithm and enable Adreno Idler (Why)
My battery's still crap:
Check if settings were applied correctly.
Try lower input_boost_ms value (at cost of snappiness, can introduce stutter while scrolling)
Check for wakelocks using BetterBatteryStats
Disable Keep Awake/Wi-Fi scan for Google Play Services (unknown side effects):
Settings -> Privacy -> Privacy Guard -> Advanced (dropdown) -> Google Play Services -> Keep Awake/Wi-Fi-Scan
Disable Keep Awake for apps that refuse to sleep, like Facebook and other battery hoggers.
Greenify
General Battery Tips
Disable location when not using
Remove extra widgets from the desktop
Disable live wallpapers
Settings -> Wi-Fi -> Configure -> Keep Wi-Fi on during sleep - Only when plugged in
Settings -> Wi-Fi -> Configure -> uncheck - "Network notification"
Disable unnecessary sync
Disable automatic updates and notifications for updates on Google Play.
Disable push and notification of social networks.
Do not use Task-killers
Do not use programs and widgets to monitor daily usage of the smartphone.
If the quality of the LTE network connection is poor, switch the "Network Type" to 3G or 2G
Source: https://4pda.ru/forum/index.php?showtopic=707426
Obvious:
Use lower brightness (try to keep it below 30%)
Prefer Wi-Fi networks and disable data connections when not using.
Settings explained:
Code:
Android Documentation
https://android.googlesource.com/kernel/common/+/android-4.4-n-release/Documentation/
Kernel - Virtual Memory
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
Performance Testing with SSDs Pt. 2 by Toby Chappell Systems
https://devs.mailchimp.com/blog/performance-testing-with-ssds-pt-2/
How is Heterogeneous Multi-Processing (HMP) scheduling implemented in Linux Kernel (Samsung Exynos5422)?
http://stackoverflow.com/questions/25498215/how-is-heterogeneous-multi-processing-hmp-scheduling-implemented-in-linux-kern
Scheduler Documentation (from DTS Eagle Integration into [Code Aurora Forum] Android (kernel))
https://github.com/dtsinc/DTS-Eagle-Integration_CAF-Android-kernel/blob/master/Documentation/scheduler/sched-hmp.txt
# Read-ahead cache
# Typically, larger values increase sequential read speed and slightly reduce the random read speed. The larger the cache, the less growth
and the more compromises.
# Setting rq_affinity to 2 tells the kernel that the specific CPU core that requested the I/O must be the one that completes it.
# add_random with a setting of 0 avoids the overheard of I/O events contributing to the entropy pool in /dev/random.
# Standard I/O elevator operations include attempts to merge contiguous I/Os. For known random I/O loads these attempts will always fail
and result in extra cycles being spent in the kernel. This allows one to turn off this behavior on one of two ways: When set to 1,
complex merge checks are disabled, but the simple one-shot merges with the previous I/O request are enabled. When set to 2, all merge
tries are disabled. The default value is 0 - which enables all types of merge tries.
# https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block
# Laptop mode is used to minimize the time that the hard disk needs to be spun up,
# to conserve battery power. It has been reported to cause significant power savings.
# When the knob is set, any physical disk I/O (that might
# have caused the hard disk to spin up) causes Linux to flush all dirty blocks. The
# result of this is that after a disk has spun down, it will not be spun up
# anymore to write dirty blocks, because those blocks had already been written
# immediately after the most recent read operation. The value of the laptop_mode
# knob determines the time between the occurrence of disk I/O and when the flush
# is triggered.
# A task whose nice value is greater than this tunable value will never be considered as a "big" task (it will not be allowed to run
on a high-performance CPU).
# android background processes are set to nice 10. Never schedule these on the big cluster.
# echo 9 > /proc/sys/kernel/sched_upmigrate_min_nice # 15 default, 9 to never schedule background tasks on big Cluster, and 7
on Project Zhana
Known bugs:
Kernel Adiutor seems to change minimum number of big cores to 2 on Core Control. Avoid checking 'Hotplug' tab when using scripts with core_ctl support (try Kernel Adiutor-Mod if problem persists).
Thanks for credits
What auto run booting???
cenelyanto said:
What auto run booting???
Click to expand...
Click to collapse
Copy file to /etc/init.d and set the right permissions (see FAQ).
Keep in mind these scripts are deprecated.
booting noot run otomatic step by step for on ...otomatis run booting

Categories

Resources