[PATCH] Sched: 3.1 CKolivas BFSv414
The Brain Fuck Scheduler v0.414 by Con Kolivas.

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

Excellent throughput and latency for 1 to many CPUs on desktop and server
commodity hardware.
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.

-ck
[PATCH] Sched: BFS: v414-v415
[PATCH] Sched: BFS: fix non-bfs build
Disabling BFS breaks building. Keep wrong variable type from mainline to fix
build.

-ck
[PATCH] cpufreq: BFS tweaks
[PATCH] Sched: BFS: clear deactivated sticky
Make sure to clear the sticky flag when deactivating a task to prevent it
generating unnecessary resched_closest_idle calls in swap_sticky.

-ck
[PATCH] Sched: BFS: correct int size
[PATCH] Sched: BFS: dont use task
resched_suitable_idle can end up dereferencing on p in resched_best_mask so
pass the cpu and rq and not the task to the function.

-ck
[PATCH] Sched: BFS: remove prefetch
Prefetch is only of questionable benefit and breaks arm builds so remove it.

-ck
[PATCH] Sched: BFS: remove rqpreempt
Remove the rq->preempt entry. It could lead to some rare races on fork & process exit.

-ck
[PATCH] Sched: BFS: stickybol
[PATCH] mm: background scan
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.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

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.

Signed-off-by: Chase Venters <chase.venters at clientec.com>

-ck
[PATCH] mm: drop swap cache aggressively
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.

-ck
[PATCH] mm: swaptoken only when swap full
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.

-ck
[PATCH] Sched: add above background load func
Add an "above background load" function which can be used for background
tasks elsewhere (e.g. VM).

-ck