diff options
| author | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-09-23 13:28:33 -0400 |
|---|---|---|
| committer | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-09-23 13:28:33 -0400 |
| commit | c98651d6dfdee7eba0134354583919dd9d2afbcf (patch) | |
| tree | a0080396d20a4ae8ae5dc37172c5043270906885 /include/litmus | |
| parent | 5eacf27747940e3a33f2b48f6335c6fa255598f5 (diff) | |
Checkpoint1(Updated)
Encounters problem where task waits an extra period due to
sleep(unresolved)
Diffstat (limited to 'include/litmus')
| -rw-r--r-- | include/litmus/reservations/ext_reservation.h | 9 | ||||
| -rw-r--r-- | include/litmus/reservations/gedf_reservation.h | 22 | ||||
| -rw-r--r-- | include/litmus/reservations/task_reservation.h | 16 |
3 files changed, 26 insertions, 21 deletions
diff --git a/include/litmus/reservations/ext_reservation.h b/include/litmus/reservations/ext_reservation.h index 7ec326bd14bd..68784f71a268 100644 --- a/include/litmus/reservations/ext_reservation.h +++ b/include/litmus/reservations/ext_reservation.h | |||
| @@ -23,6 +23,12 @@ typedef void (*drain_budget_t) ( | |||
| 23 | int cpu | 23 | int cpu |
| 24 | ); | 24 | ); |
| 25 | 25 | ||
| 26 | typedef struct task_struct* (*dispatch_client_t) ( | ||
| 27 | struct reservation *reservation, | ||
| 28 | lt_t now, | ||
| 29 | int cpu | ||
| 30 | ); | ||
| 31 | |||
| 26 | /* When reservation is scheduled. */ | 32 | /* When reservation is scheduled. */ |
| 27 | typedef void (*on_schedule_t) ( | 33 | typedef void (*on_schedule_t) ( |
| 28 | struct reservation *reservation, | 34 | struct reservation *reservation, |
| @@ -42,6 +48,7 @@ typedef void (*shutdown_t)(struct reservation *reservation); | |||
| 42 | struct reservation_ops { | 48 | struct reservation_ops { |
| 43 | drain_budget_t drain_budget; | 49 | drain_budget_t drain_budget; |
| 44 | replenish_budget_t replenish_budget; | 50 | replenish_budget_t replenish_budget; |
| 51 | dispatch_client_t dispatch_client; | ||
| 45 | on_schedule_t on_schedule; | 52 | on_schedule_t on_schedule; |
| 46 | on_preempt_t on_preempt; | 53 | on_preempt_t on_preempt; |
| 47 | shutdown_t shutdown; | 54 | shutdown_t shutdown; |
| @@ -53,7 +60,7 @@ struct reservation { | |||
| 53 | /* exact meaning defined by impl. */ | 60 | /* exact meaning defined by impl. */ |
| 54 | lt_t priority; | 61 | lt_t priority; |
| 55 | lt_t cur_budget; | 62 | lt_t cur_budget; |
| 56 | lt_t next_replenishment; | 63 | lt_t replenishment_time; |
| 57 | 64 | ||
| 58 | /* budget stats */ | 65 | /* budget stats */ |
| 59 | lt_t budget_consumed; /* how much budget consumed in this allocation cycle? */ | 66 | lt_t budget_consumed; /* how much budget consumed in this allocation cycle? */ |
diff --git a/include/litmus/reservations/gedf_reservation.h b/include/litmus/reservations/gedf_reservation.h index e2a4a3dc5968..57f2fa7f00fc 100644 --- a/include/litmus/reservations/gedf_reservation.h +++ b/include/litmus/reservations/gedf_reservation.h | |||
| @@ -22,19 +22,33 @@ struct gedf_reservation { | |||
| 22 | struct cpu_entry* scheduled_on; | 22 | struct cpu_entry* scheduled_on; |
| 23 | int will_remove; | 23 | int will_remove; |
| 24 | int blocked; | 24 | int blocked; |
| 25 | }; | ||
| 26 | |||
| 27 | struct gedf_task_reservation { | ||
| 28 | struct gedf_reservation gedf_res; | ||
| 29 | struct task_struct* task; | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct gedf_container_reservation { | ||
| 33 | struct gedf_reservation gedf_res; | ||
| 34 | lt_t max_budget; | ||
| 25 | lt_t period; | 35 | lt_t period; |
| 26 | lt_t relative_deadline; | 36 | lt_t relative_deadline; |
| 27 | lt_t exec_cost; | ||
| 28 | }; | 37 | }; |
| 29 | 38 | ||
| 30 | long alloc_gedf_reservation( | 39 | long alloc_gedf_container_reservation( |
| 31 | struct gedf_reservation** _res, | 40 | struct gedf_container_reservation** _res, |
| 32 | int id, | 41 | int id, |
| 33 | lt_t exec_cost, | 42 | lt_t max_budget, |
| 34 | lt_t period, | 43 | lt_t period, |
| 35 | lt_t relative_deadline | 44 | lt_t relative_deadline |
| 36 | ); | 45 | ); |
| 37 | 46 | ||
| 47 | long alloc_gedf_task_reservation( | ||
| 48 | struct gedf_task_reservation** _res, | ||
| 49 | struct task_struct* task | ||
| 50 | ); | ||
| 51 | |||
| 38 | /* environment for scheduling reservations via gedf */ | 52 | /* environment for scheduling reservations via gedf */ |
| 39 | struct gedf_reservation_environment { | 53 | struct gedf_reservation_environment { |
| 40 | struct reservation_environment env; | 54 | struct reservation_environment env; |
diff --git a/include/litmus/reservations/task_reservation.h b/include/litmus/reservations/task_reservation.h deleted file mode 100644 index 0e0ef74591b6..000000000000 --- a/include/litmus/reservations/task_reservation.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #ifndef LITMUS_TASK_RESERVATION_H | ||
| 2 | #define LITMUS_TASK_RESERVATION_H | ||
| 3 | |||
| 4 | #include <litmus/reservations/ext_reservation.h> | ||
| 5 | |||
| 6 | struct task_reservation_environment { | ||
| 7 | struct reservation_environment env; | ||
| 8 | struct task_struct* task; | ||
| 9 | }; | ||
| 10 | |||
| 11 | long alloc_task_reservation_environment( | ||
| 12 | struct task_reservation_environment** _env, | ||
| 13 | struct task_struct* task | ||
| 14 | ); | ||
| 15 | |||
| 16 | #endif | ||
