sched: Cleanup pre_schedule_rt

From: Yong Zhang <yong.zhang0@gmail.com>
Date: Tue, 9 Feb 2010 19:43:59 +0000 (-0500)
Subject: sched: Cleanup pre_schedule_rt
X-Git-Tag: v3.1-rc1~298^2~19^2~3
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=33c3d6c61debcc0d295fe65521cfbc45409936c7

Since [commit 9a897c5a:
sched: RT-balance, replace hooks with pre/post schedule and wakeup methods]
we must call pre_schedule_rt if prev is rt task.
So condition rt_task(prev) is always true and the 'unlikely' declaration is
simply incorrect.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
sched: Change pick_next_task_rt from unlikely to likely

From: Steven Rostedt <srostedt@redhat.com>
Date: Mon, 6 Dec 2010 16:28:30 +0000 (-0500)
Subject: sched: Change pick_next_task_rt from unlikely to likely
X-Git-Tag: v3.1-rc1~298^2~19^2~2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=8e54a2c036d8c47195f094af1628834f4c55844a

The if (unlikely(!rt_rq->rt_nr_running)) test in pick_next_task_rt()
tests if there is another rt task ready to run. If so, then pick it.

In most systems, only one RT task runs at a time most of the time.
Running the branch unlikely annotator profiler on a system doing average
work "running firefox, evolution, xchat, distcc builds, etc", it showed the
following:

 correct incorrect  %        Function                  File              Line
 ------- ---------  -        --------                  ----              ----
  324344 135104992  99 _pick_next_task_rt             sched_rt.c           1064

99% of the time the condition is true. When an RT task schedules out,
it is unlikely that another RT task is waiting to run on that same run queue.

Simply remove the unlikely() condition.

Acked-by: Gregory Haskins <ghaskins@novell.com>
Cc:Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
sched: Remove unlikely() from rt_policy() in sched.c

From: Steven Rostedt <srostedt@redhat.com>
Date: Mon, 6 Dec 2010 19:48:10 +0000 (-0500)
Subject: sched: Remove unlikely() from rt_policy() in sched.c
X-Git-Tag: v3.1-rc1~298^2~19^2~1
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=63f01241176d7cbc976385aec32f0a209b0bc36a

The rt_policy() has an unlikely() that the policy it is checking is
of RT priority (SCHED_FIFO or SCHED_RR).

According to the annotate branch profiler it is incorrect most of the time:

 correct incorrect  %        Function                  File              Line
 ------- ---------  -        --------                  ----              ----
   36667   654674  94 rt_policy                      sched.c              126

This makes sense because the rt_policy() is used by the sched_set_scheduler()
and nice(). Although users may use sys_nice a bit, all RT users use
the sched_set_scheduler() to set their RT priority, including kernel
threads.

The above numbers were from a normal desktop computer running
firefox, evolution, xchat and was part of a distcc compile farm.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
sched: Remove unlikely() from ttwu_post_activation

From: Steven Rostedt <srostedt@redhat.com>
Date: Mon, 6 Dec 2010 22:10:31 +0000 (-0500)
Subject: sched: Remove unlikely() from ttwu_post_activation
X-Git-Tag: v3.1-rc1~298^2~19^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=e69c634190dc724ef2d845ace8d783031d3e492e

The unlikely() used in ttwu_post_activation() tests if the rq->idle_stamp
is set. But since this is for a wakeup, and wakeups happen when tasks
block on IO, and blocking tasks on IO may put the system into idle,
this can actually be a common occurence.

Running the annotated branch profiler on an average desktop running
firefox, evolution, xchat and distcc, the report shows:

 correct incorrect  %        Function             File              Line
 ------- ---------  -        --------             ----              ----
34884862 146110926  80 ttwu_post_activation      sched.c            2309

80% of the time, this unlikely is incorrect. Best not to assume what the
result is, and just remove the branch annotation.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
ARM: entry: no need to increase preempt count for IRQ handlers

From: Russell King <rmk+kernel@arm.linux.org.uk>
Date: Sat, 25 Jun 2011 09:57:57 +0000 (+0100)
Subject: ARM: entry: no need to increase preempt count for IRQ handlers
X-Git-Tag: v3.1-rc1~258^2~1^3~16
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=1613cc1119ecdb1bdb950da53065e615e4c4b8db

irq_enter() and irq_exit() already take care of the preempt_count
handling for interrupts, which increment and decrement the hardirq
bits of the preempt count.  So we can remove the preempt count handing
in our IRQ entry/exit assembly, like x86 did some 9 years ago.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
sched: disable gentle fair sleepers

From 3a2533dae23f673cba8c51dca93f99cba72cc4dd Mon Sep 17 00:00:00 2001
From: TripNRaVeR <noerialexeew@live.nl>
Date: Thu, 22 Mar 2012 00:12:13 +0100
Subject: [PATCH] sched: disable gentle fair sleepers
rcu: add JRCU for small SMP systems

From 179d99e8435463a8c2fac3b231cb4d76635ed28c Mon Sep 17 00:00:00 2001
From: TripNRaVeR <noerialexeew@live.nl>
Date: Thu, 22 Mar 2012 01:22:45 +0100
Subject: [PATCH] rcu: add JRCU for small SMP systems
jrcu: Added missing jrcu files
xt_log.h: avoid compile warning
governor: Added CPUfreq governor 'lazy'

From 869cd93f9f8f0159e5e266a5d1b5df9a97f9615a Mon Sep 17 00:00:00 2001
From: Ezekeel <notezekeel@googlemail.com>
Date: Sat, 17 Dec 2011 07:21:14 +0100
Subject: [PATCH] Added CPUfreq governor 'lazy'.
block: add V(R) I/O scheduler

From 7c20cb49eaa96d6108e50a09e66008bcdbdd7c44 Mon Sep 17 00:00:00 2001
From: TripNRaVeR <noerialexeew@live.nl>
Date: Thu, 22 Mar 2012 20:13:01 +0100
Subject: [PATCH] block: add V(R) I/O scheduler
genlock: remove genlock_release_lock and associated ioctl

From 7e8414985d0e31cbe497dc564358c539c8df8371 Mon Sep 17 00:00:00 2001
From: TripNRaVeR <noerialexeew@live.nl>
Date: Thu, 22 Mar 2012 22:14:13 +0100
Subject: [PATCH] genlock: remove genlock_release_lock and associated ioctl
SLQB: add SLQB memory allocator

!!! Don't use it actually - more work to have it ready !!!

From 8115a9f7a6c88fc22fb6fdc90ae003f63bbfbff1 Mon Sep 17 00:00:00 2001
From: edoko <r_data@naver.com>
Date: Sat, 28 Jan 2012 11:01:21 +0900
Subject: [PATCH] Added SLQB Memory Allocator (Nick Piggin)