Revert "Trying static, although the comment makes me think i should try the opposite of what the code was doing."

This reverts commit 7b05e49b3a3453cf99f2c23d045984862ec4a701.

Conflicts:

	arch/arm/kernel/auto_hotplug.c
Revert "Revert "Trying static, although the comment makes me think i should try the opposite of what the code was doing.""

This reverts commit 6c0d22877eac7c0f966bb28b76426ecb5900025e.
Linux v3.0.76

Signed-off-by: Seongmin Park <r_data@naver.com>
sio: Adjust writes_starved value

Signed-off-by: Seongmin Park <r_data@naver.com>
deadline: Allow 0ms deadline latency, increase the read speed

Change a timer compare from after to after-equals, thus allowing
0 timeout and making deadline schedule FIFO.

Signed-off-by: xiaobing tu <xiaobing.tu@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: deadline: hardcode magic values from the usual suspects.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:

	block/deadline-iosched.c

Signed-off-by: Seongmin Park <r_data@naver.com>
block: deadline: fix magic values.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Dispatch requests according to their io-priority

This patch implements "application-hints" which is a way the issuing
application can notify the scheduler on the priority of its request.
This is done by setting the io-priority of the request.
This patch reuses an already existing mechanism of io-priorities developed
for CFQ. Please refer to kernel/Documentation/block/ioprio.txt for
usage example and explanations.

Change-Id: I228ec8e52161b424242bb7bb133418dc8b73925a
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>

Conflicts:

	block/row-iosched.c
block: row: Idling mechanism re-factoring

At the moment idling in ROW is implemented by delayed work that uses
jiffies granularity which is not very accurate. This patch replaces
current idling mechanism implementation with hrtime API, which gives
nanosecond resolution (instead of jiffies).

Change-Id: I86c7b1776d035e1d81571894b300228c8b8f2d92
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Don't notify URGENT if there are un-completed urgent req

When ROW scheduler reports to the block layer that there is an urgent
request pending, the device driver may decide to stop the transmission
of the current request in order to handle the urgent one. If the current
transmitted request is an urgent request - we don't want it to be
stopped.
Due to the above ROW scheduler won't notify of an urgent request if
there are urgent requests in flight.

Change-Id: I2fa186d911b908ec7611682b378b9cdc48637ac7
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

Conflicts:

	block/row-iosched.c

Signed-off-by: Seongmin Park <r_data@naver.com>

Conflicts:

	block/row-iosched.c
block: row: Update initial values of ROW data structures

This patch sets the initial values of internal ROW
parameters.

Change-Id: I38132062a7fcbe2e58b9cc757e55caac64d013dc
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
[smuckle@codeaurora.org: ported from msm-3.7]
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>

Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Re-design urgent request notification mechanism

This patch updates the ROW URGENT notification policy to apply with the
bellow:
- Don't notify URGENT if there is an un-completed URGENT request in driver
- After notifying that URGENT request is present, the next request
  dispatched is the URGENT one.
- At every given moment only 1 request can be marked as URGENT.
  Independent of it's location (driver or scheduler)

Other changes to URGENT policy:
- Only queues that are allowed to notify of an URGENT request pending
are READ queues

Change-Id: I17ff73125bc7a760cea1116b466115a2df635a14
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>

Conflicts:

	block/row-iosched.c
block: row: Re-design urgent request notification mechanism

When ROW scheduler reports to the block layer that there is an urgent
request pending, the device driver may decide to stop the transmission
of the current request in order to handle the urgent one. This is done
in order to reduce the latency of an urgent request. For example:
long WRITE may be stopped to handle an urgent READ.

This patch updates the ROW URGENT notification policy to apply with the
below:

- Don't notify URGENT if there is an un-completed URGENT request in driver
- After notifying that URGENT request is present, the next request
  dispatched is the URGENT one.
- At every given moment only 1 request can be marked as URGENT.
  Independent of it's location (driver or scheduler)

Other changes to URGENT policy:
- Only READ queues are allowed to notify of an URGENT request pending.

CR fix:
If a pending urgent request (A) gets merged with another request (B)
A is removed from scheduler queue but is not removed from
rd->pending_urgent_rq.

CRs-Fixed: 453712
Change-Id: I321e8cf58e12a05b82edd2a03f52fcce7bc9a900
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

Conflicts:

	block/row-iosched.c

Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Prevent starvation of regular priority by high priority

At the moment all REGULAR and LOW priority requests are starved as long as
there are HIGH priority requests to dispatch.
This patch prevents the above starvation by setting a starvation limit the
REGULAR\LOW priority requests can tolerate.

Change-Id: Ibe24207982c2c55d75c0b0230f67e013d1106017
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Update sysfs functions

All ROW (time related) configurable parameters are stored in ms so there
is no need to convert from/to ms when reading/updating them via sysfs.

Change-Id: Ib6a1de54140b5d25696743da944c076dd6fc02ae
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: Fix starvation tolerance values

The current starvation tolerance values increase the boot time
since high priority SW requests are delayed by regular priority requests.
In order to overcome this, increase the starvation tolerance values.

Change-Id: I9947fca9927cbd39a1d41d4bd87069df679d3103
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Seongmin Park <r_data@naver.com>
block: row: hardcode magic values.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
block: row: fix one of the magic values. Thanks @osm0sis.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Seongmin Park <r_data@naver.com>