From 8b637fddc7f9a91febdb7fb398ac0a5f97d491ee Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Thu, 20 May 2010 14:33:27 -0400 Subject: Added support for choices in budget policy enforcement. 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. --- include/litmus/litmus.h | 2 ++ include/litmus/rt_param.h | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include/litmus') 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) return get_exec_time(t) >= get_exec_cost(t); } +#define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) + #define is_hrt(t) \ (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 { RT_CLASS_BEST_EFFORT } task_class_t; +typedef enum { + NO_ENFORCEMENT, /* job may overrun unhindered */ + QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ + PRECISE_ENFORCEMENT /* NOT IMPLEMENTED - enforced with hrtimers */ +} budget_policy_t; + struct rt_task { lt_t exec_cost; lt_t period; lt_t phase; - unsigned int cpu; - task_class_t cls; + unsigned int cpu; + task_class_t cls; + budget_policy_t budget_policy; /* ignored by pfair */ }; /* The definition of the data that is shared between the kernel and real-time -- cgit v1.2.2