[T-Mobile, Samsung Galaxy SIII] Perseus:
4. I/O SCHEDULER ADJUSTMENTS

Ref -

https://www.kernel.org/doc/Documentation/block/

http://www.linux-mag.com/id/7572/

http://algo.ing.unimo.it/people/paolo/disk_sched/description.php

The Scheduler Adjustments are parameters that determine how the selected Scheduler behaves. Needless to say the list of parameters in this menu will change depending on which Scheduler you chose in the previous step. The screenshot depicts parameters for the ROW Scheduler. Even though there are quite a few Schedulers available in this kernel, parameters of some of them tend to be similar in effect. Hence I have combined the Schedulers whose parameters are similar.

​

[FONT=&quot] Deadline, SIO and Zen: [/FONT][FONT=&quot]

fifo_batch: This parameter controls the maximum number of requests per batch.[/FONT][FONT=&quot]It tunes the balance between per-request latency and aggregate throughput. When low latency is the primary concern, smaller is better (where a value of 1 yields first-come first-served behavior). Increasing fifo_batch generally improves throughput, at the cost of latency variation. [/FONT]The default is 16.[FONT=&quot]

front_merges: A request that enters the scheduler is possibly contiguous to a request that is already on the queue. Either it fits in the back of that request, or it fits at the front. Hence it’s called either a back merge candidate or a front merge candidate. Typically back merges are much more common than front merges. You can set this tunable to 0 if you know your workload will never generate front merges. Otherwise leave it at its default value 1.

[/FONT][FONT=&quot]read_expire: In all 3 schedulers, there is some form of deadline to service each Read Request. The focus is read latencies. When a read request first enters the io scheduler, it is assigned a deadline that is the current time + the read_expire value in units of milliseconds. The default value is 500 ms.

write_expire: Similar to Read_Expire, this applies only to the Write Requests. The default value is 5000 ms.[/FONT][FONT=&quot]

writes_starved: Typically more attention is given to the Read requests over write requests. But this can’t go on forever. So after the expiry of this value, some of the pending write requests get the same priority as the Reads. Default value is 1.

This tunable controls how many read batches can be processed before processing a single write batch. The higher this is set, the more preference is given to reads.

CFQ

back_seek_max: The scheduler tries to guess that the next request for access requires going backwards from current position on the Disc. Given that such going back can be time consuming. So in anticipation, may move back on the disc prior to the next request. This setting, given in Kb, determines the max distance to go back. Default value is set to 16 Kb.

Do note that in a cellphone or tablet, the storage is actually Flash Memory technology. There is Disk head to be re-positioned. As such this is not that effective as backward reads are not that bad.

[/FONT][FONT=&quot]back_seek_penalty: This parameter is used to compute the cost of backward seeking. If the backward distance of a request is just 1 from a front request, then the seeking cost of the two requests is considered equivalent and the scheduler will not bias toward one or the other. This parameter defaults to 2 so if the distance is only 1/2 of the forward distance, CFQ will consider the backward request to be close enough to the current head location to be “close”. Therefore it will consider it as a forward request.

fifo_expire_async & fifo_expire_sync : This particular parameter is used to set the timeout of asynchronous requests. CFQ maintains a fifo (first-in, first-out) list to manage timeout requests. The default value is 250 ms. A smaller value means the timeout is considered much more quickly than a larger value. Similarly, fifo_expire_sync applies to the Synchronous requests. The default is 125 ms.

[/FONT][FONT=&quot]group_idle: If this is set, CFQ will idle before executing the last process issuing I/O in a cgroup. This should be set to 1 along with using proportional weight I/O cgroups and setting slice_idle to 0 as Flash memory is a fast storage mechanism.

group_isolation: If set (to 1), there is a stronger isolation between groups at the expense of throughput. If disabled, Scheduler is biased towards sequential requests. When enabled group isolation provides balance for both sequential and random workloads. The default value is 0 (disabled). [/FONT][FONT=&quot]

low_latency: When set (to 1), CFQ attempts to build a backlog of write requests. It will give a maximum wait time of 300 ms for each process issuing I/O on a device. This offers fairness over throughput. When disabled (set to 0), it will ignore target latency, allowing each process in the system to get a full time slice. This is enabled by default.

[/FONT][FONT=&quot]Quantum: This option controls the maximum number of requests being processed at a time. The default value is 8. Increasing the value can improve performance; the latency of some I/O may be increased due to more requests being buffered inside the storage.

[/FONT][FONT=&quot]slice_async: This parameter controls Maximum number of asynchronous requests at a time. The default value is set to 40 ms.[/FONT][FONT=&quot]

slice_idle: When a task has no more requests to submit in its time slice, the scheduler waits for a while before scheduling the next thread to improve locality. The default value is 0 indicating no idling. However, a zero value increases the overall number of seeks. Hence a Non-zero number may be beneficial.

slice_sync: This setting determines the time slice allotted to a process I/O. The default is 100 ms.

BFQ

timeout_sync & timeout_async: These parameters determine maximum disk time given to a task, respectively for synchronous and asynchronous queues. It allows the user to control the latencies imposed by the scheduler.

[/FONT][FONT=&quot]max_budget: This determines, how much of the queue request is serviced based on number of sectors on disc. A larger value increases the throughput for the single tasks and for the system, in proportion to the percentage of sequential requests issued. Consequence is increasing the maximum latency a request may incur in. The default value is 0, which enables auto-tuning

[/FONT][FONT=&quot]max_budget_async_rq: This setting determines number of async queues served for a maximum number of requests, before selecting a new queue.[/FONT][FONT=&quot]

low_latency: When this is set to 1 (default is 1), interactive and soft real-time applications experience a lower latency.

Row:

[/FONT][FONT=&quot]hp_read_quantum: Dispatch quantum for the high priority READ queue

rp_read_quantum: Dispatch quantum for the regular priority READ queue

hp_swrite_quantum: Dispatch quantum for the high priority Synchronous WRITE queue

rp_swrite_quantum: Dispatch quantum for the regular priority Synchronous WRITE queue

rp_write_quantum: Dispatch quantum for the regular priority WRITE queue

lp_read_quantum: Dispatch quantum for the low priority READ queue

lp_swrite_quantum: Dispatch quantum for the low priority Synchronous WRITE queue

read_idle: Determines length of idle on read queue in Msec (in case idling is enabled on that queue).

read_idle_freq: Determines the frequency of inserting READ requests that will trigger idling. This is the time in Msec between inserting two READ requests[/FONT]