linux .10 > .13
Update: Linux upstream 2.6.35.13 > 2.6.35.14

Signed-off-by: jstotero <asterione@gmail.com>
removed lg-electronic from mkcompile_h - added jst in .config - removed .config from .gitignore
sched: automated per-uid task group Android is a privilege-separated operating system, in which each application runs with a distinct system identity: the Linux user ID (uid).

Automatically create CFS task groups per UID. Each Android application runs
with its own distinct UID, so grouping tasks by UID and put them in the same
task group allows to get a fair share of CPU time per application.

Testcase:
  - run 4 cpu hog in background as user app_35 (com.android.email in my case)
  - run the Quadrant benchmark (http://www.aurorasoftworks.com/products/quadrant)
    as a different user and measure the result with and without the patch

 # su - app_35
 $ for i in `seq 4`; do yes >/dev/null & done

Without the patch (output of top):
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
 6533   123 10070    R     202m 48.6   0 20.0 com.aurorasoftworks.quadrant.ui.st
 6506     1 10035    R     1128  0.2   0 20.0 yes
 6507     1 10035    R     1128  0.2   0 20.0 yes
 6508     1 10035    R     1128  0.2   0 20.0 yes
 6509     1 10035    R     1128  0.2   0 20.0 yes

Benchmark result: 676

 uid 10035 (cpu hog)  : 60.0 % cpu quota
 uid 10070 (benchmark): 20.0 % cpu quota

With automated per-uid task group (output of top):
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
 6784   123 10070    S     209m 51.4   0 50.0 com.aurorasoftworks.quadrant.ui.st
 6852     1 10035    R     1128  0.2   0 12.5 yes
 6853     1 10035    R     1128  0.2   0 12.5 yes
 6854     1 10035    R     1128  0.2   0 12.5 yes
 6855     1 10035    R     1128  0.2   0 12.5 yes

Benchmark result: 816

 uid 10035 (cpu hog)  : 45.9 % cpu quota
 uid 10070 (benchmark): 46.0 % cpu quota

Total speedup: ~1.2 (the benchmark is about 20% faster in this case)

Based on the patch "sched: automated per tty task groups" by Mike Galbraith.

Signed-off-by: Andrea Righi <arighi@develer.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: jstotero <asterione@gmail.com>
block: prepare I/O context code for BFQ

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: Francesco Allertsen <fallertsen@gmail.com>
block: add cgroups, kconfig and build bits for BFQ

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>
block: introduce the BFQ I/O scheduler

Add the BFQ-v1-r1 I/O scheduler to 2.6.35.
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 automaticall
       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.

    - 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 classes the bandwidth is distributed
      in proportion to the weights of each queue.

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: Fabio Checconi <fabio@gandalf.sssup.it>
Signed-off-by: Paolo Valente <paolo.valente@unimore.it>

Ported the following commits to bfq:
    - cfq-iosched: compact io_context radix_tree (80b15c7389caa)
    - cfq-iosched: remove dead_key from cfq_io_context (bca4b914b5da3d8e)
Prepare for overclock - Export frequency table in MSM cpufreq driver
enable overclock
updated .config for overclock
Fix atomic functions in bfq

Signed-off-by: jstotero <asterione@gmail.com>