2.6.34-sched-bfs-318.patch

The Brain Fuck Scheduler v0.318 by Con Kolivas.

A single shared runqueue O(n) strict fairness earliest deadline first design.

Ultra low latency and excellent desktop performance for 1 to many CPUs.
Not recommended for 4096 cpus.

Scalability is optimal when your workload is equal to the number of CPUs on
bfs. ie you should ONLY do make -j4 on quad core, -j2 on dual core and so on.

Features SCHED_IDLEPRIO and SCHED_ISO scheduling policies as well.
You do NOT need to use these policies for good performance, they are purely
optional for even better performance in extreme conditions.

To run something idleprio, use schedtool like so:

schedtool -D -e make -j4

To run something isoprio, use schedtool like so:

schedtool -I -e amarok

Includes accurate sub-tick accounting of tasks so userspace reported
cpu usage may be very different if you have very short lived tasks.
cpufreq-bfs_tweaks.patch

Because of the way BFS works it needs to transition up in frequency more
aggressively and down more conservatively.

-ck
mm-background_scan.patch

Add a background scanning timer to restore the watermarks to the pages_lots
level and only call on it if kswapd has not been called upon for the last 5
seconds. This allows us to balance all zones to the more generous pages_lots
watermark at a time unrelated to page allocation thus leading to lighter
levels of vm load when called upon under page allocation.

The -ck patches modify mm/vmscan.c and add a timer to wake up kswapd every 5
seconds. This timer is initialized after the creation of the kswapd thread.

The kswapd() thread function calls mod_timer at the front of its infinite
service loop (to reset the timer to 5 seconds in the future). mod_timer()
includes a BUG_ON() to assert that the timer's callback function is set.

Since the wakeup timer is initialized after the kswapd thread is created, if
kswapd gets scheduled before kswapd_run() has prepared the timer, the
BUG_ON() check will throw a stack trace and immediately terminate the kswapd
thread.

This patch modifies the kswapd_run() function in mm/vmscan.c to initialize the
watermark timer before starting the kswapd thread.
mm-drop_swap_cache_aggressively.patch

While it may be nice to have a copy of pages on swap once written there, the
more garbage we leave in the swapspace the slower any further writes and
reads to and from it are. Just free swapcache whenever we can.
mm-enable_swaptoken_only_when_swap_full.patch

The swap token is only useful in conditions of swap thrash, and actually
worsens the common case by causing more swapping. Make it only have an effect
when swap is more than half full.
Add sched_bfs files
mm-kswapd_inherit_prio-1.patch

When kswapd is awoken due to reclaim by a running task, set the priority of
kswapd to that of the calling task thus making memory reclaim cpu activity
affected by nice level.
mm-lru_cache_add_lru_tail.patch

When reading from large files through the generic file read functions into
page cache we can detect when a file is so large that it is unlikely to be
fully cached in ram. If that happens we can put it on the tail end of the
inactive lru list so it can be the first thing evicted next time we need ram.

Do lots of funny buggers with underscores to preserve all the existing APIs.
mm-make_swappiness_really_mean_it.patch

Swappiness the tunable lies. It doesn't respect swappiness because it alters
the value when we're more than lightly loaded in the vm. Change it to -really-
mean swappiness unless we're about to go out of memory.
mm-zero_swappiness.patch

Yet to see a desktop workload that benefits from swappiness being higher than
zero. Make it so by default.
sched-add-above-background-load-function.patch

sched-add-above-background-load-function.patch
mm-idleprio_prio-1.patch

Set the effective priority of idleprio tasks to that of nice 19 tasks when
modifying vm reclaim behaviour.
[TLBB] Use BFS scheduler
[PATCH 1/3] 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.
[PATCH 2/3] 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.
[PATCH 3/3] block: introduce the BFQ I/O scheduler

Add the BFQ I/O scheduler.  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).
[TLBB] Use BFQ I/O Scheduler
Revert "Enable CEC debug"

This reverts commit 602c43951accc8a9262ec94048e9757fc50e0781.
Add No WP check pin to cardreader
Apply Linux 2.6.34.14 patch