aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/edf_common.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-09-17 19:31:04 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-09-17 19:31:04 -0400
commitba54b1096870fba6e3bbb99aafc713e76b747353 (patch)
tree26727a7f89ca520392fec0b559f09500cb9934ac /litmus/edf_common.c
parentef0974bf8e768b38d728f3bba147332ddea1e11b (diff)
Fixed three bugs with aux threads and nested locks
Fixes two bugs with nested locks: 1) List of aux threads could become corrupted. -- moved modifications to be within scheduler lock. 2) Fixed bad EDF comparison ordering that could lead to schedule thrashing in an infinite loop. 3) Prevent aux threads from inheriting a priority from a task that is blocked on a real-time litmus lock. (since the aux threads can't possibly hold these locks, we don't have to worry about inheritance.)
Diffstat (limited to 'litmus/edf_common.c')
-rw-r--r--litmus/edf_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/litmus/edf_common.c b/litmus/edf_common.c
index 7e0d3a5d0c4d..f4881452373d 100644
--- a/litmus/edf_common.c
+++ b/litmus/edf_common.c
@@ -237,6 +237,7 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
237 second_task->rt_param.is_proxy_thread) { 237 second_task->rt_param.is_proxy_thread) {
238 return 1; 238 return 1;
239 } 239 }
240 else if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) {
240#endif 241#endif
241 242
242#ifdef CONFIG_REALTIME_AUX_TASKS 243#ifdef CONFIG_REALTIME_AUX_TASKS
@@ -244,6 +245,7 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
244 if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { 245 if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) {
245 return 1; 246 return 1;
246 } 247 }
248 else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) {
247#endif 249#endif
248 250
249 /* Something could be wrong if you get this far. */ 251 /* Something could be wrong if you get this far. */
@@ -281,6 +283,14 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
281 return 1; 283 return 1;
282 } 284 }
283 } 285 }
286
287#ifdef CONFIG_REALTIME_AUX_TASKS
288 }
289#endif
290#ifdef CONFIG_LITMUS_SOFTIRQD
291 }
292#endif
293
284 } 294 }
285 } 295 }
286 } 296 }