[patch] optimize activate_task()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>


--- ./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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux