cpufreq: Add cpu-boost driver

When certain bursty and important events take place, it might take a while
for the current cpufreq governor to notice the new load and react to it.
That would result in poor user experience. To alleviate this, the cpu-boost
driver boosts the frequency of a CPU for a short duration to maintain good
user experience while the governor catches up.

Specifically, this commit deals with ensuring that when "important" tasks
migrate from a fast CPU to a slow CPU, the frequency of the slow CPU is
boosted to be at least as high as the fast CPU for a short duration.

Since this driver enforces the boost by hooking into standard cpufreq
ADJUST notifiers, it has several advantages:
- More portable across kernel versions where the cpufreq internals might
  have been rewritten.
- Governor agnostic and hence works with multiple governors like
  conservative, ondemand, interactive, etc.
- Does not affect the sampling period/logic of existing governors.
- Can have the boost period adjusted independent of governor sampling
  period.

Change-Id: Ibd814a20043d0aba64ee7637a4a79b9ffa1b0991
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
cpufreq: Add a sync limit to cpu-boost

Perform frequency synchronization only when source CPU's frequency
is less than sync_threshold, else sync to the sync_threshold.

Change-Id: I544c414568d4e015b80ce5891dd215275bac95da
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
cpufreq: Add Input Boost feature to the cpu-boost driver

On incoming input events boost the frequency of all online cpus
for at least input_boost_ms ms. This is accomplished by changing
the policy->min of all the online cpus to input_boost_freq.

Change-Id: Idb0ab75d68ae4ceff259cbbaaec1a9bb3bc871d3
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Add TRIPNDROID scheduler

* Thanks TripNDroid Mobile Engineering
Revert "bfq-iosched: Set bfq_back_penalty = 1"

This reverts commit 626905b1f9f6497e77f723f7a4f3af4ccf4d7004.
Revert "bfq-iosched: Tuning for SSD"

This reverts commit 37afb6a1ec5028523046328152fba660d26c25e9.
Revert "block: introduce the BFQ-v7r2 I/O sched for 3.4"

This reverts commit bb0b0b364b62f5ba4e01c457d3a2f5aad0c6d73c.
block: introduce the BFQ-v7r3 I/O sched for 3.4
block, bfq: add Early Queue Merge (EQM) to BFQ-v7r3 for 3.4.0
bfq-iosched: Tuning for SSD
bfq-iosched: Set bfq_back_penalty = 1
Revert "bfq-iosched: Set bfq_back_penalty = 1"

This reverts commit aaff9965439061556342db317d00fed80149e8c9.
Revert "bfq-iosched: Tuning for SSD"

This reverts commit 9704d174137dc244ff054811b1f4b8ff6ed96f15.
Revert "block, bfq: add Early Queue Merge (EQM) to BFQ-v7r3 for 3.4.0"

This reverts commit cf84fead6fb19b9bc07f41f91d62b80dfff88a3b.
Revert "block: introduce the BFQ-v7r3 I/O sched for 3.4"

This reverts commit f1a7f4588a6f5ae443a0419940eb97e6c57ac9eb.
block: introduce the BFQ-v7r4 I/O sched for 3.4
block, bfq: add Early Queue Merge (EQM) to BFQ-v7r4 for 3.4.0"
bfq-iosched: Tuning for SSD
bfq-iosched: Set bfq_back_penalty = 1
block: Reserve only one queue tag for sync IO if only 3 tags are available

In case a device has three tags available we still reserve two of them
for sync IO. That leaves only a single tag for async IO such as
writeback from flusher thread which results in poor performance.

Allow async IO to consume two tags in case queue has three tag availabe
to get a decent async write performance.

This patch improves streaming write performance on a machine with such disk
from ~21 MB/s to ~52 MB/s. Also postmark throughput in presence of
streaming writer improves from 8 to 12 transactions per second so sync
IO doesn't seem to be harmed in presence of heavy async writer.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>