diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-06-26 04:45:31 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-07-23 05:58:00 -0400 |
commit | c1350f82ee53098f52b712877c3b8e0876952f52 (patch) | |
tree | a5b43bfe9f93cad0b70be4e213e9fa66e2fb1c9c /include/litmus | |
parent | c2034d8205674daa954ee314f93270f39b90148f (diff) |
P-FP: Clarify meaning of priorities
Add a comment to explain how priorities are
interpreted, and provide some useful macros for
userspace.
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/rt_param.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 1ce96af51287..c4669a276e6f 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -33,7 +33,25 @@ typedef enum { | |||
33 | PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ | 33 | PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ |
34 | } budget_policy_t; | 34 | } budget_policy_t; |
35 | 35 | ||
36 | #define LITMUS_MAX_PRIORITY 512 | 36 | /* We use the common priority interpretation "lower index == higher priority", |
37 | * which is commonly used in fixed-priority schedulability analysis papers. | ||
38 | * So, a numerically lower priority value implies higher scheduling priority, | ||
39 | * with priority 1 being the highest priority. Priority 0 is reserved for | ||
40 | * priority boosting. LITMUS_MAX_PRIORITY denotes the maximum priority value | ||
41 | * range. | ||
42 | */ | ||
43 | |||
44 | #define LITMUS_MAX_PRIORITY 512 | ||
45 | #define LITMUS_HIGHEST_PRIORITY 1 | ||
46 | #define LITMUS_LOWEST_PRIORITY (LITMUS_MAX_PRIORITY - 1) | ||
47 | |||
48 | /* Provide generic comparison macros for userspace, | ||
49 | * in case that we change this later. */ | ||
50 | #define litmus_higher_fixed_prio(a, b) (a < b) | ||
51 | #define litmus_lower_fixed_prio(a, b) (a > b) | ||
52 | #define litmus_is_valid_fixed_prio(p) \ | ||
53 | ((p) >= LITMUS_HIGHEST_PRIORITY && \ | ||
54 | (p) <= LITMUS_LOWEST_PRIORITY) | ||
37 | 55 | ||
38 | struct rt_task { | 56 | struct rt_task { |
39 | lt_t exec_cost; | 57 | lt_t exec_cost; |