diff options
Diffstat (limited to 'litmus/edf_common.c')
-rw-r--r-- | litmus/edf_common.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/litmus/edf_common.c b/litmus/edf_common.c index 9b44dc2d8d1e..0a06d7a26c00 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c | |||
@@ -63,8 +63,52 @@ int edf_higher_prio(struct task_struct* first, | |||
63 | 63 | ||
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | if (!is_realtime(second_task)) | ||
67 | return true; | ||
68 | |||
69 | if (earlier_deadline(first_task, second_task)) | ||
70 | return true; | ||
71 | |||
72 | if (get_deadline(first_task) == get_deadline(second_task)) | ||
73 | { | ||
74 | if (shorter_period(first_task, second_task)) | ||
75 | { | ||
76 | return true; | ||
77 | } | ||
78 | if (get_rt_period(first_task) == get_rt_period(second_task)) | ||
79 | { | ||
80 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
81 | if (first_task->rt_param.is_proxy_thread < second_task->rt_param.is_proxy_thread) | ||
82 | { | ||
83 | return true; | ||
84 | } | ||
85 | if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) | ||
86 | { | ||
87 | #endif | ||
88 | if (first_task->pid < second_task->pid) | ||
89 | { | ||
90 | return true; | ||
91 | } | ||
92 | if (first_task->pid == second_task->pid) | ||
93 | { | ||
94 | return !second->rt_param.inh_task; | ||
95 | } | ||
96 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
97 | } | ||
98 | #endif | ||
99 | } | ||
100 | } | ||
101 | |||
102 | return false; | ||
66 | 103 | ||
104 | #if 0 | ||
67 | return !is_realtime(second_task) || | 105 | return !is_realtime(second_task) || |
106 | |||
107 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
108 | /* proxy threads always lose w/o inheritance. */ | ||
109 | (first_task->rt_param.is_proxy_thread < | ||
110 | second_task->rt_param.is_proxy_thread) || | ||
111 | #endif | ||
68 | 112 | ||
69 | /* is the deadline of the first task earlier? | 113 | /* is the deadline of the first task earlier? |
70 | * Then it has higher priority. | 114 | * Then it has higher priority. |
@@ -82,6 +126,7 @@ int edf_higher_prio(struct task_struct* first, | |||
82 | */ | 126 | */ |
83 | (first_task->pid == second_task->pid && | 127 | (first_task->pid == second_task->pid && |
84 | !second->rt_param.inh_task))); | 128 | !second->rt_param.inh_task))); |
129 | #endif | ||
85 | } | 130 | } |
86 | 131 | ||
87 | int edf_ready_order(struct bheap_node* a, struct bheap_node* b) | 132 | int edf_ready_order(struct bheap_node* a, struct bheap_node* b) |