From c58a74c8ad2d2b1b01be12afb9bac58dfef0d16a Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Sun, 16 Sep 2012 18:29:36 -0400 Subject: Added CONFIG_REALTIME_AUX_TASKS option Auxillary task features were enabled by CONFIG_LITMUS_LOCKING. Made auxillary tasks a seperate feature that depends upon CONFIG_LITMUS_LOCKING. --- litmus/edf_common.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'litmus/edf_common.c') diff --git a/litmus/edf_common.c b/litmus/edf_common.c index ca06f6ec103e..7e0d3a5d0c4d 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c @@ -22,7 +22,7 @@ #include #endif -//#ifdef CONFIG_EDF_TIE_BREAK_HASH +#if defined(CONFIG_EDF_TIE_BREAK_HASH) || defined(CONFIG_REALTIME_AUX_TASKS) #include static inline long edf_hash(struct task_struct *t) { @@ -41,8 +41,9 @@ static inline long edf_hash(struct task_struct *t) */ return hash_32(hash_32((u32)tsk_rt(t)->job_params.job_no, 32) ^ t->pid, 32); } -//#endif +#endif +#ifdef CONFIG_REALTIME_AUX_TASKS int aux_tie_break(struct task_struct *first, struct task_struct *second) { long fhash = edf_hash(first); @@ -57,6 +58,7 @@ int aux_tie_break(struct task_struct *first, struct task_struct *second) } return 0; } +#endif /* edf_higher_prio - returns true if first has a higher EDF priority @@ -75,11 +77,6 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) struct task_struct *first_task = first; struct task_struct *second_task = second; - int first_lo_aux; - int second_lo_aux; - int first_hi_aux; - int second_hi_aux; - /* There is no point in comparing a task to itself. */ if (first && first == second) { TRACE_CUR("WARNING: pointless edf priority comparison: %s/%d\n", first->comm, first->pid); @@ -93,8 +90,14 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) return first && !second; } -#ifdef CONFIG_LITMUS_LOCKING +#ifdef CONFIG_REALTIME_AUX_TASKS + { + /* statically prioritize all auxillary tasks that have no inheritance + * below all other regular real-time tasks. + */ + 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; second_lo_aux = second->rt_param.is_aux_task && !second->rt_param.inh_task; @@ -120,8 +123,10 @@ 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 - +#ifdef CONFIG_LITMUS_LOCKING /* Check for EFFECTIVE priorities. Change task * used for comparison in such a case. */ @@ -233,11 +238,13 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) return 1; } #endif + +#ifdef CONFIG_REALTIME_AUX_TASKS + /* is this dead code? */ if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { - TRACE_CUR("AUX BREAK!\n"); return 1; } - +#endif /* Something could be wrong if you get this far. */ if (unlikely(first->rt_param.inh_task == -- cgit v1.2.2