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: Dan Trifan <jimsth@gmail.com>
block: deadline: change the winning tunables again.

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

Conflicts:
	block/deadline-iosched.c
freezer: shorten freezer sleep time using exponential backoff

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
[PATCH, v9] cgroups: introduce timer slack controller

Changelog:

v9:
 - update documentation
 - minor cleanup
v8:
 - change hiearchy rules
 - introduce timer_slack.effective_slack_ns
 - get_task_timer_slack() -> task_get_effective_timer_slack()
 - task_get_effective_timer_slack() splited in separate patch
 - implement PR_GET_EFFECTIVE_TIMERSLACK
v7:
 - totally reworked interface and rewritten from scratch
   (See Documentation/cgroups/timer_slack.txt for more information)
v6:
 - add documentation
 - use notifier_call_chain() instead of check hook
 - fix validate_change()
 - cleanup
v5:
 - -EBUSY on writing to timer_slack.min_slack_ns/max_slack_ns if a child has
   wider min-max range
v4:
 - hierarchy support
 - drop dummy_timer_slack_check()
 - workaround lockdep false (?) positive
 - allow 0 as timer slack value
v3:
 - rework interface
 - s/EXPORT_SYMBOL/EXPORT_SYMBOL_GPL/
v2:
 - fixed with CONFIG_CGROUP_TIMER_SLACK=y
v1:
 - initial revision

---

[PATCH, v9 1/3] hrtimer: introduce effective timer slack

task_get_effective_timer_slack() returns timer slack value to be used
to configure per-task timers. It can be equal or higher than task's
timer slack value.

For now task_get_effective_timer_slack() returns timer_slack_ns of the
task. Timer slack cgroup controller will implement a bit more
sophisticated logic.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

---

[PATCH, v9 2/3] hrtimer: implement PR_GET_EFFECTIVE_TIMERSLACK

PR_GET_EFFECTIVE_TIMERSLACK allows process to know its effective timer
slack value.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

---

[PATCH, v9 3/3] cgroups: introduce timer slack controller

Every task_struct has timer_slack_ns value. This value uses to round up
poll() and select() timeout values. This feature can be useful in
mobile environment where combined wakeups are desired.

Originally, prctl() was the only way to change timer slack value of
a process. So you was not able change timer slack value of another
process.

cgroup subsys "timer_slack" implements timer slack controller. It
provides a way to set minimal timer slack value for a group of tasks.
If a task belongs to a cgroup with minimal timer slack value higher than
task's value, cgroup's value will be applied.

Timer slack controller allows to implement setting timer slack value of
a process based on a policy. For example, you can create foreground and
background cgroups and move tasks between them based on system state.

Idea-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

---

kernel/cgroup_timer_slack.c: fix compile error

kernel/cgroup_timer_slack.c:41: error: implicit declaration of
function 'ERR_PTR'

Signed-off-by: Boy Petersen <boypetersen@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
cgroup/timer_slack: fix cgroup permission errors

Since the common mounting of cpu and timer_slack into /dev/cpuctl
in commit
https://github.com/boype/kernel_tuna_jb42/commit/f23ab456002c2d3b416260862dbfdb82b031a450
the Android OS cannot move processes across cgoups anymore:

    W/SchedPolicy( 1180): add_tid_to_cgroup failed to write '5949'
    (Permission denied); policy=0

Fix this by implementing an 'allow_attach' handler, according to
this commit:
https://github.com/boype/kernel_tuna_jb42/commit/bb5b603036b99d80527b222dc98eba4ee8341020

Signed-off-by: Boy Petersen <boypetersen@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
fs/dcache.c: adaptive vfs_cache_pressure on suspend / resume

low vfs_cache pressure values save battery while idle, while
a low value also causes stutter with longer up times.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
fs/dache.c / mm/page-writeback.c: allow modification of dirty_-values and cache_pressure despite the dynamic suspend/resume values

Signed-off-by: Dan Trifan <jimsth@gmail.com>
optimized LPDDR RAM timings (~10% throughput increase)

Tweaked the device's RAM timings. Benchmarks suggest a 10
percent thorughput improvement (RgBandwidth RAM misc benchmark;
threads: 1. 20 benchmark instances each, best result wins):

       Stock          Tweaked

Copy   1249.9 MB/s -> 1373.0 MB/s --> 9.86 % improvement
Scale  1084.8 MB/s -> 1188.1 MB/s --> 9.52 % improvement
Add    938.4 MB/s  -> 1050.2 MB/s --> 11.91 % improvement
Triad  923.0 MB/s  -> 1043.5 MB/s --> 13.06 % improvement

Signed-off-by: Dan Trifan <jimsth@gmail.com>
Boottime: A tool for automatic measurement of kernel/bootloader boot time

From: Jonas Aaberg <jonas.aberg@stericsson.com>

The overhead is very low and the results will be found under
sysfs/bootime, as well as detailed results in debugfs under
boottime/. The bootgraph* files are compatible with
scripts/bootgraph.pl. The reason for this patch is to provide
data (sysfs/boottime) suitable for automatic testcases as
well as help for developers to reduce the boot time (debugfs).

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Tested-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
backported from Linux 3.6+ to Tuna Hybrid kernel by faux123

Signed-off-by: Dan Trifan <jimsth@gmail.com>
defconfig: enable BootTime

Signed-off-by: Dan Trifan <jimsth@gmail.com>