mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[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 <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: Nick Piggin <[email protected]> Cc: "Siddha, Suresh B" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
06066714f6
commit
62ab616d54
1 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue