[PATCH 4/5] sched: remove unlikelys from sched_move_task

Steven Rostedt
2009-03-25T05:21:47Z

[-- Attachment #1: 0004-sched-remove-unlikelys-from-sched_move_task.patch --]
[-- Type: text/plain, Size: 1260 bytes --]

From: Steven Rostedt <rostedt@goodmis.org>

Impact: clean up

We seem to be moving running tasks more than non running tasks.
I guess tasks like to move themselves.

These are also candidates for likely:

correct incorrect % Function File Line
------- --------- - -------- ---- ----
0 10027 100 sched_move_task sched.c 8918
0 10027 100 sched_move_task sched.c 8908

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/sched.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 8e2558c..5a60745 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8905,7 +8905,7 @@ void sched_move_task(struct task_struct *tsk)

if (on_rq)
dequeue_task(rq, tsk, 0);
- if (unlikely(running))
+ if (running)
tsk->sched_class->put_prev_task(rq, tsk);

set_task_rq(tsk, task_cpu(tsk));
@@ -8915,7 +8915,7 @@ void sched_move_task(struct task_struct *tsk)
tsk->sched_class->moved_group(tsk);
#endif

- if (unlikely(running))
+ if (running)
tsk->sched_class->set_curr_task(rq);
if (on_rq)
enqueue_task(rq, tsk, 0);
--
1.6.2

--