struct rt_info* sched_hvdf(struct list_head *head, int flags)
{
	struct rt_info *task, *best = local_task(head->next);

	/*Check for each entry in the list*/
	list_for_each_entry(task, head, task_list[LOCAL_LIST]){

	/* Check if task is aborted, if yes, the return it. Otherwise
	   check if the deadline is blown, if yes, abort the task using 
	   abort_thread(). {Done in handle_task_failure() function.}
	 */
		if(check_task_failure(task, flags))
			return task;

	/* Calculate inverse value density for the current task.*/
		livd(task, false, flags);

	/* Compare the inverse value densities and assign the higher value
	   density task to best.
	 */
		if(task->local_ivd < best->local_ivd)
			best = task ;

	}


	if(flags & SCHED_FLAG_PI)
		best = get_pi_task(best, head, flags);

	return best;
}
Ejemplo n.º 2
0
struct rt_info* sched_rma(struct list_head *head, int flags)
{
	struct rt_info *best = local_task(head->next);

	if(flags & SCHED_FLAG_PI)
		best = get_pi_task(best, head, flags);

	return best;
}
Ejemplo n.º 3
0
struct rt_info* sched_hvdf(struct list_head *head, int flags)
{
	struct rt_info *it, *best = local_task(head->next);

	list_for_each_entry(it, head, task_list[LOCAL_LIST]) {
		if(check_task_failure(it, flags))
			return it;

		livd(it, false, flags);
		if(it->local_ivd < best->local_ivd)
			best = it;
	}

	if(flags & SCHED_FLAG_PI)
		best = get_pi_task(best, head, flags);

	return best;
}