summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2006-12-10 11:20:36 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-10 18:55:43 +0100
commit62ab616d54371a65f595c199aad1e1755b837d25 (patch)
tree5615868bc04901a48f28ecc3da7cc3de035a5662 /kernel/sched.c
parent[PATCH] sched: remove lb_stopbalance counter (diff)
downloadlinux-62ab616d54371a65f595c199aad1e1755b837d25.tar.xz
linux-62ab616d54371a65f595c199aad1e1755b837d25.zip
[PATCH] sched: optimize activate_task for RT task
RT task does not participate in interactiveness priority and thus shouldn't be bothered with timestamp and p->sleep_type manipulation when task is being put on run queue. Bypass all of the them with a single if (rt_task) test. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 66e44b5b53d2..48e35c916326 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -940,6 +940,9 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
{
unsigned long long now;
+ if (rt_task(p))
+ goto out;
+
now = sched_clock();
#ifdef CONFIG_SMP
if (!local) {
@@ -961,8 +964,7 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
(now - p->timestamp) >> 20);
}
- if (!rt_task(p))
- p->prio = recalc_task_prio(p, now);
+ p->prio = recalc_task_prio(p, now);
/*
* This checks to make sure it's not an uninterruptible task
@@ -987,7 +989,7 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
}
}
p->timestamp = now;
-
+out:
__activate_task(p, rq);
}