Skip to content

Commit

Permalink
[PATCH] optimize activate_task()
Browse files Browse the repository at this point in the history
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@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <piggin@cyberone.com.au>
Cc: Con Kolivas <kernel@kolivas.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Chen, Kenneth W authored and Linus Torvalds committed Nov 10, 2005
1 parent 6730c3c commit a47ab93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a47ab93

Please sign in to comment.