aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/edf_common.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-23 18:13:11 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-23 18:13:11 -0500
commit821a500d34ae6b2487a2ebecc6ab276fdfde0680 (patch)
tree0033c2a08bdf02116e97788627e0d2857ad05259 /litmus/edf_common.c
parent95717fa9f4b9f725928e898c42fb0e711e896311 (diff)
Fix AUX tasks from being dropped by Litmus.
Diffstat (limited to 'litmus/edf_common.c')
-rw-r--r--litmus/edf_common.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/litmus/edf_common.c b/litmus/edf_common.c
index ef22eb93dbf3..32ee5f464ef8 100644
--- a/litmus/edf_common.c
+++ b/litmus/edf_common.c
@@ -259,8 +259,6 @@ klmirqd_tie_break:
259 } 259 }
260 pid_break = (fhash == shash); 260 pid_break = (fhash == shash);
261#else 261#else
262
263
264 /* CONFIG_EDF_PID_TIE_BREAK */ 262 /* CONFIG_EDF_PID_TIE_BREAK */
265 pid_break = 1; // fall through to tie-break by pid; 263 pid_break = 1; // fall through to tie-break by pid;
266#endif 264#endif
@@ -271,31 +269,27 @@ klmirqd_tie_break:
271 return 1; 269 return 1;
272 } 270 }
273 else if (first_task->pid == second_task->pid) { 271 else if (first_task->pid == second_task->pid) {
272 /* there is inheritance going on. consider inheritors. */
274#ifdef CONFIG_LITMUS_SOFTIRQD 273#ifdef CONFIG_LITMUS_SOFTIRQD
275 if (tsk_rt(first_task)->is_interrupt_thread < tsk_rt(second_task)->is_interrupt_thread) { 274 /* non-interrupt thread gets prio */
275 if (!tsk_rt(first)->is_interrupt_thread && tsk_rt(second)->is_interrupt_thread) {
276 return 1; 276 return 1;
277 } 277 }
278 else if (tsk_rt(first_task)->is_interrupt_thread == tsk_rt(second_task)->is_interrupt_thread) { 278 else if (tsk_rt(first)->is_interrupt_thread == tsk_rt(second)->is_interrupt_thread) {
279#endif 279#endif
280 280
281#if defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE) 281#if defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE)
282 if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { 282 /* non-aux thread gets prio */
283 if (!tsk_rt(first)->is_aux_task && tsk_rt(second)->is_aux_task) {
283 return 1; 284 return 1;
284 } 285 }
285 else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) { 286 else if (tsk_rt(first_task)->is_aux_task == tsk_rt(second_task)->is_aux_task) {
286#endif 287#endif
287 288 /* if both tasks inherit from the same task */
288 /* Something could be wrong if you get this far. */ 289 if (tsk_rt(first)->inh_task == tsk_rt(second)->inh_task) {
289 if (unlikely(tsk_rt(first)->inh_task == tsk_rt(second)->inh_task)) { 290 /* TODO: Make a recurive call to edf_higher_prio,
290 /* Both tasks have the same inherited priority. 291 comparing base priorities. */
291 * Likely in a bug-condition. 292 return (first->pid < second->pid);
292 */
293 if (first->pid < second->pid) {
294 return 1;
295 }
296 else if (first->pid == second->pid) {
297 //WARN_ON(1);
298 }
299 } 293 }
300 else { 294 else {
301 /* At least one task must inherit */ 295 /* At least one task must inherit */
@@ -304,18 +298,6 @@ klmirqd_tie_break:
304 298
305 /* The task withOUT the inherited priority wins. */ 299 /* The task withOUT the inherited priority wins. */
306 if (tsk_rt(second)->inh_task) { 300 if (tsk_rt(second)->inh_task) {
307 /*
308 * common with aux tasks.
309 TRACE_CUR("unusual comparison: "
310 "first = %s/%d first_task = %s/%d "
311 "second = %s/%d second_task = %s/%d\n",
312 first->comm, first->pid,
313 (tsk_rt(first)->inh_task) ? tsk_rt(first)->inh_task->comm : "(nil)",
314 (tsk_rt(first)->inh_task) ? tsk_rt(first)->inh_task->pid : 0,
315 second->comm, second->pid,
316 (tsk_rt(second)->inh_task) ? tsk_rt(second)->inh_task->comm : "(nil)",
317 (tsk_rt(second)->inh_task) ? tsk_rt(second)->inh_task->pid : 0);
318 */
319 return 1; 301 return 1;
320 } 302 }
321 } 303 }