Skip to contentSkip to conversation

optimize activate_task()

PATCH In review Chen, Kenneth W 2 participants 2 messages Oct 27, 2005 – Oct 28, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

kernel/sched.c renamed from kernel/sched.c.orig +2 -1
@@ -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
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Chen, Kenneth W

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.

Ingo