diff options
| author | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-05-20 14:33:27 -0400 |
|---|---|---|
| committer | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-05-20 14:33:27 -0400 |
| commit | 8b637fddc7f9a91febdb7fb398ac0a5f97d491ee (patch) | |
| tree | 838097851d047e26a0f06625b4b867e0f5aec777 /include | |
| parent | 3813e4586d0f05bdcfdf8a09e535949d2d28fba9 (diff) | |
Added support for choices in budget policy enforcement.wip-budget
NO_ENFORCEMENT - A job may execute beyond its declared execution time.
Jobs notify the kernel that they are complete via liblitmus's
sleep_next_period()
QUANTUM_ENFORCEMENT - The kernel terminates a job if its actual execution
time exceeds the declared execution time.
PRECISE_ENFORCEMENT - Hook declared, but not yet implemented. Plan to
support this policy through hrtimers. Error thrown if specified.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/litmus.h | 2 | ||||
| -rw-r--r-- | include/litmus/rt_param.h | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 62107e659c12..d515d1af1096 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
| @@ -83,6 +83,8 @@ inline static int budget_exhausted(struct task_struct* t) | |||
| 83 | return get_exec_time(t) >= get_exec_cost(t); | 83 | return get_exec_time(t) >= get_exec_cost(t); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | #define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) | ||
| 87 | |||
| 86 | 88 | ||
| 87 | #define is_hrt(t) \ | 89 | #define is_hrt(t) \ |
| 88 | (tsk_rt(t)->task_params.class == RT_CLASS_HARD) | 90 | (tsk_rt(t)->task_params.class == RT_CLASS_HARD) |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 5b94d1a8eea7..a7a183f34a80 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
| @@ -27,12 +27,19 @@ typedef enum { | |||
| 27 | RT_CLASS_BEST_EFFORT | 27 | RT_CLASS_BEST_EFFORT |
| 28 | } task_class_t; | 28 | } task_class_t; |
| 29 | 29 | ||
| 30 | typedef enum { | ||
| 31 | NO_ENFORCEMENT, /* job may overrun unhindered */ | ||
| 32 | QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ | ||
| 33 | PRECISE_ENFORCEMENT /* NOT IMPLEMENTED - enforced with hrtimers */ | ||
| 34 | } budget_policy_t; | ||
| 35 | |||
| 30 | struct rt_task { | 36 | struct rt_task { |
| 31 | lt_t exec_cost; | 37 | lt_t exec_cost; |
| 32 | lt_t period; | 38 | lt_t period; |
| 33 | lt_t phase; | 39 | lt_t phase; |
| 34 | unsigned int cpu; | 40 | unsigned int cpu; |
| 35 | task_class_t cls; | 41 | task_class_t cls; |
| 42 | budget_policy_t budget_policy; /* ignored by pfair */ | ||
| 36 | }; | 43 | }; |
| 37 | 44 | ||
| 38 | /* The definition of the data that is shared between the kernel and real-time | 45 | /* The definition of the data that is shared between the kernel and real-time |
