diff options
author | Tanya Amert <tamert@cs.unc.edu> | 2020-10-13 22:46:07 -0400 |
---|---|---|
committer | Tanya Amert <tamert@cs.unc.edu> | 2020-10-13 22:46:07 -0400 |
commit | 93ac9b1b2106d5230dbebde903d8460eb31ff5b2 (patch) | |
tree | 78d2be48f6864258d79b4b80f633ccf07f3f6639 /litmus | |
parent | 31ed856e2e8dce5f579c97b41e136dc03c2a9319 (diff) | |
parent | b58595723675d016e7a8e06afcad9be8fd85de3a (diff) |
Merge branch 'EXT-RES' into omlp
Merge in change to reservation priority to avoid swapping order
of calls to higher_res_prio.
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/reservations/gedf_reservation.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/litmus/reservations/gedf_reservation.c b/litmus/reservations/gedf_reservation.c index e16be7de4902..82b3933d790a 100644 --- a/litmus/reservations/gedf_reservation.c +++ b/litmus/reservations/gedf_reservation.c | |||
@@ -24,7 +24,7 @@ struct csd_wrapper { | |||
24 | /* returns 1 if res of a has earlier deadline than res of b */ | 24 | /* returns 1 if res of a has earlier deadline than res of b */ |
25 | static int edf_ready_order(struct bheap_node* a, struct bheap_node* b) | 25 | static int edf_ready_order(struct bheap_node* a, struct bheap_node* b) |
26 | { | 26 | { |
27 | return higher_res_prio(bheap2res(b), bheap2res(a)); | 27 | return higher_res_prio(bheap2res(a), bheap2res(b)); |
28 | } | 28 | } |
29 | 29 | ||
30 | /* Functions used to maintain a heap of cpu entries in edf order | 30 | /* Functions used to maintain a heap of cpu entries in edf order |
@@ -39,7 +39,6 @@ static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) | |||
39 | struct gedf_cpu_entry *a, *b; | 39 | struct gedf_cpu_entry *a, *b; |
40 | a = _a->value; | 40 | a = _a->value; |
41 | b = _b->value; | 41 | b = _b->value; |
42 | /* use higher prio here because prio is deadline value */ | ||
43 | return higher_res_prio(&b->linked->res, &a->linked->res); | 42 | return higher_res_prio(&b->linked->res, &a->linked->res); |
44 | } | 43 | } |
45 | 44 | ||
@@ -73,8 +72,7 @@ static int edf_preemption_needed( | |||
73 | * don't know what address space we're currently in. | 72 | * don't know what address space we're currently in. |
74 | */ | 73 | */ |
75 | 74 | ||
76 | /* reversed */ | 75 | return higher_res_prio(__next_ready_res(&gedf_env->domain), &gedf_res->res); |
77 | return higher_res_prio(&gedf_res->res, __next_ready_res(&gedf_env->domain)); | ||
78 | } | 76 | } |
79 | 77 | ||
80 | /* ******************************************************************************** */ | 78 | /* ******************************************************************************** */ |
@@ -222,7 +220,7 @@ static void gedf_replenish_budget( | |||
222 | res->budget_consumed = 0; | 220 | res->budget_consumed = 0; |
223 | res->cur_budget = gedf_cont_res->max_budget; | 221 | res->cur_budget = gedf_cont_res->max_budget; |
224 | res->replenishment_time += gedf_cont_res->period; | 222 | res->replenishment_time += gedf_cont_res->period; |
225 | res->priority = res->replenishment_time + gedf_cont_res->relative_deadline; | 223 | res->priority = ULLONG_MAX - res->replenishment_time - gedf_cont_res->relative_deadline; |
226 | } | 224 | } |
227 | 225 | ||
228 | static void gedf_task_replenish_budget( | 226 | static void gedf_task_replenish_budget( |
@@ -236,12 +234,12 @@ static void gedf_task_replenish_budget( | |||
236 | prepare_for_next_period(t); | 234 | prepare_for_next_period(t); |
237 | tsk_rt(t)->completed = 0; | 235 | tsk_rt(t)->completed = 0; |
238 | sched_trace_task_release(t); | 236 | sched_trace_task_release(t); |
239 | res->priority = get_deadline(t); | 237 | res->priority = ULLONG_MAX - get_deadline(t); |
240 | res->replenishment_time = get_release(t); | 238 | res->replenishment_time = get_release(t); |
241 | } else { | 239 | } else { |
242 | sched_trace_task_completion(t, 1); | 240 | sched_trace_task_completion(t, 1); |
243 | res->replenishment_time += get_rt_period(t); | 241 | res->replenishment_time += get_rt_period(t); |
244 | res->priority = res->replenishment_time + get_rt_relative_deadline(t); | 242 | res->priority = ULLONG_MAX - res->replenishment_time - get_rt_relative_deadline(t); |
245 | TRACE_TASK(t, "overrun budget!\n"); | 243 | TRACE_TASK(t, "overrun budget!\n"); |
246 | } | 244 | } |
247 | res->budget_consumed = 0; | 245 | res->budget_consumed = 0; |