diff options
Diffstat (limited to 'litmus/edf_common.c')
-rw-r--r-- | litmus/edf_common.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/litmus/edf_common.c b/litmus/edf_common.c index 4b65be7302be..989757cdcc5c 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c | |||
@@ -103,24 +103,33 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) | |||
103 | // (first_task->pid == second_task->pid && | 103 | // (first_task->pid == second_task->pid && |
104 | // !second->rt_param.inh_task))); | 104 | // !second->rt_param.inh_task))); |
105 | 105 | ||
106 | return !is_realtime(second_task) || | 106 | if (!is_realtime(second_task)) |
107 | 107 | return true; | |
108 | /* is the deadline of the first task earlier? | 108 | |
109 | * Then it has higher priority. | 109 | if (earlier_deadline(first_task, second_task)) |
110 | */ | 110 | return true; |
111 | earlier_deadline(first_task, second_task) || | 111 | |
112 | 112 | if (get_deadline(first_task) == get_deadline(second_task)) { | |
113 | /* Do we have a deadline tie? | 113 | if (shorter_period(first_task, second_task)) { |
114 | * Then break by PID. | 114 | return true; |
115 | */ | 115 | } |
116 | (get_deadline(first_task) == get_deadline(second_task) && | 116 | if (get_rt_period(first_task) == get_rt_period(second_task)) { |
117 | (first_task->pid < second_task->pid || | 117 | #ifdef CONFIG_LITMUS_SOFTIRQD |
118 | 118 | if (first_task->rt_param.is_proxy_thread < | |
119 | /* If the PIDs are the same then the task with the EFFECTIVE | 119 | second_task->rt_param.is_proxy_thread) { |
120 | * priority wins. | 120 | return true; |
121 | */ | 121 | } |
122 | (first_task->pid == second_task->pid && | 122 | #endif |
123 | !second->rt_param.inh_task))); | 123 | if (first_task->pid < second_task->pid) { |
124 | return true; | ||
125 | } | ||
126 | if (first_task->pid == second_task->pid) { | ||
127 | return !second->rt_param.inh_task; | ||
128 | } | ||
129 | } | ||
130 | } | ||
131 | |||
132 | return false; | ||
124 | } | 133 | } |
125 | 134 | ||
126 | 135 | ||