diff options
author | Mac Mollison <mollison@cs.unc.edu> | 2010-10-04 14:46:44 -0400 |
---|---|---|
committer | Mac Mollison <mollison@cs.unc.edu> | 2010-10-04 14:46:44 -0400 |
commit | 52d432c03543e15bd41e0ac54610800a37b41487 (patch) | |
tree | 5cf8b2ade2f91ddc251a5c6f13ac4ca7dbb7ff23 | |
parent | d1dd5cb04fb727cde44e35816e987893cf0b3c8c (diff) |
Check for criticality in sched_mcrit
As opposed to edf_common
-rw-r--r-- | include/litmus/litmus.h | 1 | ||||
-rw-r--r-- | litmus/edf_common.c | 5 | ||||
-rw-r--r-- | litmus/sched_mcrit.c | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index ae55a7525105..afa71d5aa71d 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -122,7 +122,6 @@ static inline lt_t litmus_clock(void) | |||
122 | (lt_before_eq(tsk_rt(t)->job_params.deadline, now)) | 122 | (lt_before_eq(tsk_rt(t)->job_params.deadline, now)) |
123 | 123 | ||
124 | /* real-time comparison macros */ | 124 | /* real-time comparison macros */ |
125 | #define higher_criticality(a, b) ( get_crit(a) < get_crit(b) ) | ||
126 | #define earlier_deadline(a, b) (lt_before(\ | 125 | #define earlier_deadline(a, b) (lt_before(\ |
127 | (a)->rt_param.job_params.deadline,\ | 126 | (a)->rt_param.job_params.deadline,\ |
128 | (b)->rt_param.job_params.deadline)) | 127 | (b)->rt_param.job_params.deadline)) |
diff --git a/litmus/edf_common.c b/litmus/edf_common.c index eb8bc1499d92..06daec66c984 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c | |||
@@ -50,11 +50,6 @@ int edf_higher_prio(struct task_struct* first, | |||
50 | */ | 50 | */ |
51 | !second_task || !is_realtime(second_task) || | 51 | !second_task || !is_realtime(second_task) || |
52 | 52 | ||
53 | /* is the criticality of the first task higher? | ||
54 | * Then it has higher priority. | ||
55 | */ | ||
56 | higher_criticality(first_task, second_task) || | ||
57 | |||
58 | /* is the deadline of the first task earlier? | 53 | /* is the deadline of the first task earlier? |
59 | * Then it has higher priority. | 54 | * Then it has higher priority. |
60 | */ | 55 | */ |
diff --git a/litmus/sched_mcrit.c b/litmus/sched_mcrit.c index 6c93af723f54..cc2185d0d12d 100644 --- a/litmus/sched_mcrit.c +++ b/litmus/sched_mcrit.c | |||
@@ -133,7 +133,13 @@ static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) | |||
133 | /* Note that a and b are inverted: we want the lowest-priority CPU at | 133 | /* Note that a and b are inverted: we want the lowest-priority CPU at |
134 | * the top of the heap. | 134 | * the top of the heap. |
135 | */ | 135 | */ |
136 | return edf_higher_prio(b->linked, a->linked); | 136 | |
137 | if (get_crit(b->linked) == get_crit(a->linked)) { | ||
138 | return edf_higher_prio(b->linked, a->linked); | ||
139 | } | ||
140 | else { | ||
141 | return get_crit(b->linked) < get_crit(a->linked); /* lower criticality number == higher criticality */ | ||
142 | } | ||
137 | } | 143 | } |
138 | 144 | ||
139 | /* update_cpu_position - Move the cpu entry to the correct place to maintain | 145 | /* update_cpu_position - Move the cpu entry to the correct place to maintain |