[patch] optimize activate_task()

From: Chen, Kenneth W
Date: Wed Oct 26 2005 - 20:57:05 EST


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 <kenneth.w.chen@xxxxxxxxx>


--- ./kernel/sched.c.orig 2005-10-26 10:39:40.594015398 -0700
+++ ./kernel/sched.c 2005-10-26 18:43:12.187410006 -0700
@@ -833,7 +833,8 @@ static void activate_task(task_t *p, run
}
#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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/