aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
Diffstat (limited to 'litmus')
-rw-r--r--litmus/edf_common.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/litmus/edf_common.c b/litmus/edf_common.c
index 9b44dc2d8d1e..668737f0fbf9 100644
--- a/litmus/edf_common.c
+++ b/litmus/edf_common.c
@@ -63,25 +63,35 @@ int edf_higher_prio(struct task_struct* first,
63 63
64#endif 64#endif
65 65
66 66 /* Determine the task with earliest deadline, with
67 return !is_realtime(second_task) || 67 * tie-break logic.
68 68 */
69 /* is the deadline of the first task earlier? 69 if (unlikely(!is_realtime(second_task))) {
70 return 1;
71 }
72 else if (earlier_deadline(first_task, second_task)) {
73 /* Is the deadline of the first task earlier?
70 * Then it has higher priority. 74 * Then it has higher priority.
71 */ 75 */
72 earlier_deadline(first_task, second_task) || 76 return 1;
73 77 }
74 /* Do we have a deadline tie? 78 else if (get_deadline(first_task) == get_deadline(second_task)) {
75 * Then break by PID. 79 /* Need to tie break */
76 */
77 (get_deadline(first_task) == get_deadline(second_task) &&
78 (first_task->pid < second_task->pid ||
79 80
80 /* If the PIDs are the same then the task with the inherited 81 /* Tie break by pid */
81 * priority wins. 82 if (first_task->pid < second_task->pid) {
82 */ 83 return 1;
83 (first_task->pid == second_task->pid && 84 }
84 !second->rt_param.inh_task))); 85 else if (first_task->pid == second_task->pid) {
86 /* If the PIDs are the same then the task with the
87 * inherited priority wins.
88 */
89 if (!second_task->rt_param.inh_task) {
90 return 1;
91 }
92 }
93 }
94 return 0; /* fall-through. prio(second_task) > prio(first_task) */
85} 95}
86 96
87int edf_ready_order(struct bheap_node* a, struct bheap_node* b) 97int edf_ready_order(struct bheap_node* a, struct bheap_node* b)