Revert "defconfig changes"

This reverts commit 9b395298e503f5b6f03a573acd690d1d2b82c1b0.

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
re enable lib802 and rxkill input configs
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
block: prepare I/O context code for BFQ-v3r1 for 2.6.38

BFQ uses struct cfq_io_context to store its per-process per-device data,
reusing the same code for cic handling of CFQ.  The code is not shared
ATM to minimize the impact of these patches.

This patch introduces a new hlist to each io_context to store all the
cic's allocated by BFQ to allow calling the right destructor on module
unload; the radix tree used for cic lookup needs to be duplicated
because it can contain dead keys inserted by a scheduler and later
retrieved by the other one.

Update the io_context exit and free paths to take care also of
the BFQ cic's.

Change the type of cfqq inside struct cfq_io_context to void *
to use it also for BFQ per-queue data.

A new bfq-specific ioprio_changed field is necessary, too, to avoid
clobbering cfq's one, so switch ioprio_changed to a bitmap, with one
element per scheduler.

Signed-off-by: Fabio Checconi <fabio@gandalf.sssup.it>
Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	block/Kconfig.iosched
block: cgroups, kconfig, build bits for BFQ-v3r1-2.6.38

Add a Kconfig option and do the related Makefile changes to compile
the BFQ I/O scheduler.  Also let the cgroups subsystem know about the
BFQ I/O controller.

Signed-off-by: Fabio Checconi <fabio@gandalf.sssup.it>
Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	block/Makefile
block: introduce the BFQ-v3r1 I/O sched for 2.6.38

Add the BFQ-v3r1 I/O scheduler to 2.6.38.
The general structure is borrowed from CFQ, as much of the code. A (bfq_)queue
is associated to each task doing I/O on a device, and each time a scheduling
decision has to be taken a queue is selected and it is served until it expires.

The main differences are:
    - Slices are given in the service domain: tasks are assigned budgets,
      measured in number of sectors. Once got the disk, a task must
      however consume its assigned budget within a configurable maximum time
      (by default, the maximum possible value of the budgets is automatically
      computed to comply with this timeout). This allows the desired latency
      vs "throughput boosting" tradeoff to be set.

    - Budgets are scheduled according to a variant of WF2Q+, implemented
      using an augmented rb-tree to take eligibility into account while
      preserving an O(log N) overall complexity.

    - A low-latency tunable is provided; if enabled, both interactive and soft
      real-time applications are guaranteed very low latency.

    - Latency guarantees are preserved also in presence of NCQ.

    - Useful features borrowed from CFQ: cooperating-queues merging (with
      some additional optimizations with respect to the original CFQ version),
      static fallback queue for OOM.

    - BFQ supports full hierarchical scheduling, exporting a cgroups
      interface.  Each node has a full scheduler, so each group can
      be assigned its own ioprio and an ioprio_class.

    - If the cgroups interface is used, weights can be explictly assigned,
      otherwise ioprio values are mapped to weights using the relation
      weight = IOPRIO_BE_NR - ioprio.

    - ioprio classes are served in strict priority order, i.e., lower
      priority queues are not served as long as there are higher priority
      queues.  Among queues in the same class the bandwidth is distributed
      in proportion to the weights of each queue. A very thin extra bandwidth
      is however guaranteed to the Idle class, to prevent it from starving.

Regarding what has not changed it is worth noting:
    - the handling of cfq_io_contexts to associate queues to tasks.
      Much of the code has been reused just renaming it.  (There is room for
      code sharing with CFQ but we wanted to minimize the impact of this
      patch.)

    - The handling of async queues.

    - The handling of idle windows.

    - The handling of merging.

    - The heuristics to assert that a task is worth an idle window (with
      minor modifications to hw_tag/CIC_SEEKY detection).

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Backport BFQ-V3-R1 to 2.6.35
Patched to 2.6.35.14 -- again

This reverts commit 1841bc3a643c0a5082270233c95fb306954b840b.

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	Makefile
	drivers/cpufreq/cpufreq_stats.c
	drivers/input/xen-kbdfront.c
	drivers/mmc/host/sdhci.c
	net/sunrpc/sched.c
	sound/soc/codecs/wm8994.c
Call idle notifiers
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Update interactive governor
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Fix up previous cherry-pick patch
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Add sampling_down_factor tunable to improve ondemand governor
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Use BFQ scheduler by default
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
update cpufreq_stats to comply with previous patch a little ways back
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
sched, autogroup: Autogroups and fixes.
sched, autogroup: More fixes for autogroup so that it actually works
cgroup: Set CGRP_RELEASABLE when adding to a cgroup

Changes the meaning of CGRP_RELEASABLE to be set on any cgroup
that has ever had a task or cgroup in it, or had css_get called
on it.  The bit is set in cgroup_attach_task, cgroup_create,
and __css_get.  It is not necessary to set the bit in
cgroup_fork, as the task is either in the root cgroup, in
which can never be released, or the task it was forked from
already set the bit in croup_attach_task.

Signed-off-by: Colin Cross <ccross@android.com>
cgroup: Remove call to synchronize_rcu in cgroup_attach_task

synchronize_rcu can be very expensive, averaging 100 ms in
some cases.  In cgroup_attach_task, it is used to prevent
a task->cgroups pointer dereferenced in an RCU read side
critical section from being invalidated, by delaying the
call to put_css_set until after an RCU grace period.

To avoid the call to synchronize_rcu, make the put_css_set
call rcu-safe by moving the deletion of the css_set links
into free_css_set_work, scheduled by the rcu callback
free_css_set_rcu.

The decrement of the cgroup refcount is no longer
synchronous with the call to put_css_set, which can result
in the cgroup refcount staying positive after the last call
to cgroup_attach_task returns.  To allow the cgroup to be
deleted with cgroup_rmdir synchronously after
cgroup_attach_task, have rmdir check the refcount of all
associated css_sets.  If cgroup_rmdir is called on a cgroup
for which the css_sets all have refcount zero but the
cgroup refcount is nonzero, reuse the rmdir waitqueue to
block the rmdir until free_css_set_work is called.

Signed-off-by: Colin Cross <ccross@android.com>
enable autogroup
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
ARM/Samsung: Fixes. Includes:

ARM: 6328/1: Build with -fno-dwarf2-cfi-asm
ARM: 6329/1: wire up sys_accept4() on ARM
ARM: S5P: Fix DMA coherent mask for FIMC
ARM: S5P: Decrease IO Registers memory region size on FIMC
ARM: S5PV210: Add FIMC clocks
ARM: SAMSUNG: Fix on drive strength value
ARM: SAMSUNG: Fix on s5p_gpio_[get,set]_drvstr
ARM: S5P: Add PMU device

Might improve power consumption characteristics
sched.c: export nr_running for custom governors