diff options
author | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-23 00:07:18 -0400 |
---|---|---|
committer | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-23 12:06:50 -0400 |
commit | 6b29cbb940ec64c8d49277b91b006230ac0c8617 (patch) | |
tree | 4c5d12754f04b59600ba6800c806c29ae4c41c62 | |
parent | 956d7715b06f89a210a9e73a384cf8542ff14417 (diff) |
Fixed conflicts between ext_res and litmus budget tracking
Problem:
When using litmus's budget enforcement, due various overheads, the
task's budget and the gedf_res's budget may differ a bit. When the task
overruns its budget but due to this difference still has budget
according to gedf_res, this can cause litmus to bug out due to error
checking in litmus's budget enforcement code.
Solution:
Made sure not to dispatch the task if it's out of budget in
gedf_task_dispatch_client
-rw-r--r-- | litmus/reservations/gedf_reservation.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/litmus/reservations/gedf_reservation.c b/litmus/reservations/gedf_reservation.c index e5a19e6de663..e08d3f9799e8 100644 --- a/litmus/reservations/gedf_reservation.c +++ b/litmus/reservations/gedf_reservation.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <litmus/bheap.h> | 8 | #include <litmus/bheap.h> |
9 | #include <litmus/rt_domain.h> | 9 | #include <litmus/rt_domain.h> |
10 | #include <litmus/jobs.h> | 10 | #include <litmus/jobs.h> |
11 | #include <litmus/budget.h> | ||
11 | #include <litmus/np.h> | 12 | #include <litmus/np.h> |
12 | #include <litmus/sched_trace.h> | 13 | #include <litmus/sched_trace.h> |
13 | #include <litmus/debug_trace.h> | 14 | #include <litmus/debug_trace.h> |
@@ -208,7 +209,11 @@ static struct task_struct* gedf_task_dispatch_client( | |||
208 | lt_t* time_slice, | 209 | lt_t* time_slice, |
209 | int cpu) | 210 | int cpu) |
210 | { | 211 | { |
211 | return ((struct gedf_task_reservation*)res)->task; | 212 | struct gedf_task_reservation* tmp = (struct gedf_task_reservation*)res; |
213 | if (budget_exhausted(tmp->task)) | ||
214 | return NULL; | ||
215 | else | ||
216 | return tmp->task; | ||
212 | } | 217 | } |
213 | 218 | ||
214 | static void gedf_replenish_budget( | 219 | static void gedf_replenish_budget( |