提交 62ab616d 编写于 作者: C Chen, Kenneth W 提交者: Linus Torvalds

[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: NKen Chen <kenneth.w.chen@intel.com>
Acked-by: NIngo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 06066714
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册