From 5dbf603e3ca76a3903b83aacc6bb19e6aa0d924a Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Sun, 11 Nov 2012 11:43:03 -0500 Subject: boost aux tasks unconditionally --- litmus/aux_tasks.c | 26 +++++++++++++++++++++++++- litmus/edf_common.c | 24 ++++++++++++++++++++---- litmus/litmus.c | 4 ++-- litmus/locking.c | 4 ++++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c index efda7dc0bd76..9572d960b46a 100644 --- a/litmus/aux_tasks.c +++ b/litmus/aux_tasks.c @@ -50,6 +50,7 @@ int exit_aux_task(struct task_struct *t) TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); +#if 0 list_del(&tsk_rt(t)->aux_task_node); tsk_rt(t)->is_aux_task = 0; @@ -57,6 +58,7 @@ int exit_aux_task(struct task_struct *t) if (tsk_rt(t)->inh_task) { litmus->__decrease_prio(t, NULL); } +#endif return retval; } @@ -64,6 +66,8 @@ int exit_aux_task(struct task_struct *t) static int aux_tasks_increase_priority(struct task_struct *leader, struct task_struct *hp) { int retval = 0; + +#if 0 struct list_head *pos; TRACE_CUR("Increasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); @@ -81,6 +85,7 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s TRACE_CUR("increasing %s/%d.\n", aux->comm, aux->pid); retval = litmus->__increase_prio(aux, hp); } +#endif return retval; } @@ -88,6 +93,8 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_struct *hp) { int retval = 0; + +#if 0 struct list_head *pos; TRACE_CUR("Decreasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); @@ -105,6 +112,7 @@ static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_s retval = litmus->__decrease_prio(aux, hp); } } +#endif return retval; } @@ -112,6 +120,8 @@ static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_s int aux_task_owner_increase_priority(struct task_struct *t) { int retval = 0; + +#if 0 struct task_struct *leader; struct task_struct *hp = NULL; struct task_struct *hp_eff = NULL; @@ -146,6 +156,7 @@ int aux_task_owner_increase_priority(struct task_struct *t) TRACE_CUR("%s/%d is new hp in group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); retval = aux_tasks_increase_priority(leader, hp_eff); } +#endif out: return retval; @@ -154,6 +165,8 @@ out: int aux_task_owner_decrease_priority(struct task_struct *t) { int retval = 0; + +#if 0 struct task_struct *leader; struct task_struct *hp = NULL; struct task_struct *hp_eff = NULL; @@ -189,6 +202,7 @@ int aux_task_owner_decrease_priority(struct task_struct *t) retval = aux_tasks_decrease_priority(leader, hp_eff); } } +#endif out: return retval; @@ -199,6 +213,8 @@ out: long enable_aux_task_owner(struct task_struct *t) { long retval = 0; + +#if 0 struct task_struct *leader = t->group_leader; struct task_struct *hp; @@ -226,7 +242,7 @@ long enable_aux_task_owner(struct task_struct *t) retval = aux_tasks_increase_priority(leader, (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp); } - +#endif out: return retval; @@ -235,6 +251,8 @@ out: long disable_aux_task_owner(struct task_struct *t) { long retval = 0; + +#if 0 struct task_struct *leader = t->group_leader; struct task_struct *hp; struct task_struct *new_hp = NULL; @@ -273,6 +291,7 @@ long disable_aux_task_owner(struct task_struct *t) retval = aux_tasks_decrease_priority(leader, to_inh); } +#endif out: return retval; @@ -324,7 +343,10 @@ static long __do_enable_aux_tasks(void) TRACE_CUR("AUX task in %s/%d: %s/%d:\n", leader->comm, leader->pid, t->comm, t->pid); /* hasn't been aux_tasks_increase_priorityted into rt. make it a aux. */ tsk_rt(t)->is_aux_task = 1; + +#if 0 list_add_tail(&tsk_rt(t)->aux_task_node, &tsk_aux(leader)->aux_tasks); +#endif (void)admit_aux_task(t); } @@ -346,6 +368,7 @@ static long __do_enable_aux_tasks(void) } while(t != leader); +#if 0 if (!binheap_empty(&tsk_aux(leader)->aux_task_owners)) { struct task_struct *hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), struct task_struct, rt_param); @@ -353,6 +376,7 @@ static long __do_enable_aux_tasks(void) retval = aux_tasks_increase_priority(leader, (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp); } +#endif return retval; } diff --git a/litmus/edf_common.c b/litmus/edf_common.c index f4881452373d..916b1b4309b7 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c @@ -92,10 +92,20 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) #ifdef CONFIG_REALTIME_AUX_TASKS { - /* statically prioritize all auxillary tasks that have no inheritance - * below all other regular real-time tasks. - */ + /* run aux tasks at max priority */ + if (first->rt_param.is_aux_task != second->rt_param.is_aux_task) + { + return (first->rt_param.is_aux_task > second->rt_param.is_aux_task); + } + else if(first->rt_param.is_aux_task && second->rt_param.is_aux_task) + { + first = first->group_leader; + second = second->group_leader; + } + + +#if 0 int first_lo_aux, second_lo_aux; int first_hi_aux, second_hi_aux; first_lo_aux = first->rt_param.is_aux_task && !first->rt_param.inh_task; @@ -123,6 +133,8 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) TRACE_CUR("hi aux tie break: %s/%d >> %s/%d --- %d\n", first->comm, first->pid, second->comm, second->pid, aux_hi_tie_break); return aux_hi_tie_break; } +#endif + } #endif @@ -240,12 +252,14 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) else if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) { #endif +#if 0 #ifdef CONFIG_REALTIME_AUX_TASKS /* is this dead code? */ if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { return 1; } else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) { +#endif #endif /* Something could be wrong if you get this far. */ @@ -283,10 +297,12 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) return 1; } } - +#if 0 #ifdef CONFIG_REALTIME_AUX_TASKS } #endif +#endif + #ifdef CONFIG_LITMUS_SOFTIRQD } #endif diff --git a/litmus/litmus.c b/litmus/litmus.c index d368202ab8c3..953a591fad5f 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c @@ -388,8 +388,8 @@ static void reinit_litmus_state(struct task_struct* p, int restore) #endif #ifdef CONFIG_LITMUS_NESTED_LOCKING - WARN_ON(p->rt_param.blocked_lock); - WARN_ON(!binheap_empty(&p->rt_param.hp_blocked_tasks)); +// WARN_ON(p->rt_param.blocked_lock); +// WARN_ON(!binheap_empty(&p->rt_param.hp_blocked_tasks)); #endif #ifdef CONFIG_LITMUS_SOFTIRQD diff --git a/litmus/locking.c b/litmus/locking.c index 16c936ba8139..22f46df4308a 100644 --- a/litmus/locking.c +++ b/litmus/locking.c @@ -544,6 +544,7 @@ out: void suspend_for_lock(void) { #ifdef CONFIG_REALTIME_AUX_TASKS +#if 0 unsigned int restore = 0; struct task_struct *t = current; unsigned int hide; @@ -556,16 +557,19 @@ void suspend_for_lock(void) restore = 1; tsk_rt(t)->hide_from_aux_tasks = 1; } +#endif #endif schedule(); #ifdef CONFIG_REALTIME_AUX_TASKS +#if 0 if (restore) { /* restore our state */ tsk_rt(t)->hide_from_aux_tasks = hide; } #endif +#endif } -- cgit v1.2.2