block: ioctl support for sanitize in eMMC 4.5

Adding a new ioctl to support sanitize operation in eMMC cards version 4.5.
The sanitize ioctl support helps performing this operation via user application.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: make auto block plug flush threshold per-disk based

We do auto block plug flush to reduce latency, the threshold is 16 requests.
This works well if the task is accessing one or two drives.
The problem is if the task is accessing a raid 0 device and the raid disk number is big,
say 8 or 16, 16/8 = 2 or 16/16=1, we will have heavy lock contention.

This patch makes the threshold per-disk based. The latency should be
still ok accessing one or two drives. The setup with application
accessing a lot of drives in the meantime uaually is big machine,
avoiding lock contention is more important, because any contention
will actually increase latency.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: Update ROW scheduling algorithm

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: Update ROW scheduling algorithm #2

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: Update ROW scheduling algorithm #3

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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).

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.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.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: row: Update initial values of ROW data structures This patch sets the initial values of internal ROW parameters.

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: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: blk-core: add printk_ratelimit On failure of requests the console is flooded with prints, which result in a watchdog bark. This patch limits the number of prints to console thus, avoiding the bark.

Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.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.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.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.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.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.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: urgent: Fix dispatching of URGENT mechanism There are cases when blk_peek_request is called not from blk_fetch_request thus the URGENT request may be started but the flag q->dispatched_urgent is not updated.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: drop @tsk from attempt_plug_merge() and explain sync rules attempt_plug_merge() accesses elevator without holding queue_lock and may call into ->elevator_bio_merge_fn(). The elvator is guaranteed to be valid because it's accessed iff the plugged list has requests and elevator is never exited with live requests, so as long as the elevator method can deal with unlocked access, this is safe.

Explain the sync rules around attempt_plug_merge() and drop the
unnecessary @tsk parameter.

This patch doesn't introduce any functional change.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: row: Fix forward ported functionalities

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: row: hardcode magic values.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: Remove "requeuing urgent req" error messages It is possible for URGENT request to be requeued/reinserted if it was fetched during the creation of a packed list. This end case is rare and is not handled at the moment. This patch changes the messages notifying of the above to debug level (instead of error) in order to clear the dmesg log.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
[PATCH] AIO: Don't plug the I/O queue in do_io_submit()
vfp: Change -mfpu=softvfp+vfp to neon

Thanks to Fishears for the idea!

Change-Id: Ie5086137ffefa818b5d4af16ec7f8658105957e2