Revert "msm: kgsl: forgot to add the header for the Simple Governor on the latest revert and re-add."

This reverts commit 48431e8fd2bda991f8b189b42bef92a7ee300f8d.

Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
Revert "msm: kgsl: re-add Simple Governor."

This reverts commit 0f2349d0723265f25600b1c28084fc928c19adbf.

Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
Revert "evita: enable ksm"

This reverts commit ed976e33b1b3ca10b7fec287799d65973c887feb.
Revert "mm/uksm.c: fix build errors"

This reverts commit 486a40a27ddc218d2cd8d67f5646389a6502ff86.
Revert "lib/sradix-tree.c: fixed warning: ‘item’ may be used uninitialized in this function [-Wmaybe-uninitialized]"

This reverts commit 3c7b12ed23cbe9153a0c0bd9a87e039e71272edb.
Revert "UKSM-0.1.2.2 for v3.4.x"

This reverts commit f53ffaf901ef30e8f0d61e4727e458b6b6b0682c.
block: row-iosched idling triggered by readahead pages

In the current implementation idling is triggered only by request
insertion frequency. This heuristic is not very accurate and may hit
random requests that shouldn't trigger idling. This patch uses the
PG_readahead flag in struct page's flags, which indicates that the page
is part of a readahead window, to start idling upon dispatch of a request
associated with a readahead page.

The above readehead flag is used together with the existing
insertion-frequency trigger. The frequency timer will catch read requests
which are not part of a readahead window, but are still part of a
sequential stream (and therefore dispatched in small time intervals).

Change-Id: Icb7145199c007408de3f267645ccb842e051fd00
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
block: row: change hrtimer_cancel to hrtimer_try_to_cancel

Calling hrtimer_cancel with interrupts disabled can result in a livelock.
When flushing plug list in the block layer interrupts are disabled and an
hrtimer is used when adding requests from that plug list to the scheduler.
In this code flow, if the hrtimer (which is used for idling) is set, it's
being canceled by calling hrtimer_cancel. hrtimer_cancel will perform
the following in an endless loop:
1. try cancel the timer
2. if fails - rest_cpu
the cancellation can fail if the timer function already started. Since
interrupts are disabled it can never complete.
This patch reduced the number of times the hrtimer lock is taken while
interrupts are disabled by calling hrtimer_try_co_cancel. the later will
try to cancel the timer just once and return with an error code if fails.

CRs-fixed: 499887
Change-Id: I25f79c357426d72ad67c261ce7cb503ae97dc7b9
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
mm: change initial readahead window size calculation

Change the logic which determines the initial readahead window size
such that for small requests (one page) the initial window size
will be x4 the size of the original request, regardless of the
VM_MAX_READAHEAD value. This prevents a rapid ramp-up
that could be caused due to increasing VM_MAX_READAHEAD.

Change-Id: I93d59c515d7e6c6d62348790980ff7bd4f434997
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
mm: pass readahead info down to the i/o scheduler

Some i/o schedulers (i.e. row-iosched, cfq-iosched) deploy an idling
algorithm in order to be better synced with the readahead algorithm.
Idling is a prediction algorithm for incoming read requests.

In this patch we mark pages which are part of a readahead window, by
setting a newly introduced flag. With this flag, the i/o scheduler can
identify a request which is associated with a readahead page. This
enables the i/o scheduler's idling mechanism to be en-sync with the
readahead mechanism and, in turn, can increase read throughput.

Change-Id: I0654f23315b6d19d71bcc9cc029c6b281a44b196
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
b39

Change-Id: Ib1906848663b668374d40322ac1055febf6f9ad4
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>