From: Chen, Kenneth W Date: Wed, 9 Nov 2005 23:45:29 +0000 (-0800) Subject: [PATCH] optimize activate_task() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a47ab9371e664952b1104a70ec8e9b74db3f7a5f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] optimize activate_task() recalc_task_prio() is called from activate_task() to calculate dynamic priority and interactive credit for the activating task. For real-time scheduling process, all that dynamic calculation is thrown away at the end because rt priority is fixed. Patch to optimize recalc_task_prio() away for rt processes. Signed-off-by: Ken Chen Acked-by: Ingo Molnar Cc: Nick Piggin Cc: Con Kolivas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sched.c b/kernel/sched.c index ac3f5cc3bb51..b6506671b2be 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -815,7 +815,8 @@ static void activate_task(task_t *p, runqueue_t *rq, int local) } #endif - p->prio = recalc_task_prio(p, now); + if (!rt_task(p)) + p->prio = recalc_task_prio(p, now); /* * This checks to make sure it's not an uninterruptible task