diff options
Diffstat (limited to 'include/litmus/rt_param.h')
| -rw-r--r-- | include/litmus/rt_param.h | 77 |
1 files changed, 67 insertions, 10 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 44f85a366574..6da36f50240d 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
| @@ -41,6 +41,32 @@ typedef enum { | |||
| 41 | PRECISE_SIGNALS, /* budget signals are triggered with hrtimers */ | 41 | PRECISE_SIGNALS, /* budget signals are triggered with hrtimers */ |
| 42 | } budget_signal_policy_t; | 42 | } budget_signal_policy_t; |
| 43 | 43 | ||
| 44 | typedef enum | ||
| 45 | { | ||
| 46 | /* simple - all observations counted */ | ||
| 47 | SIMPLE_AVG = 1, | ||
| 48 | SIMPLE_EWMA, | ||
| 49 | |||
| 50 | /* control chart, brute - std deviation fully calculated */ | ||
| 51 | CC_BRUTE_AVG, | ||
| 52 | CC_BRUTE_EWMA, | ||
| 53 | |||
| 54 | /* control chart, moving range - std deviation est. from moving range */ | ||
| 55 | CC_MR_AVG, | ||
| 56 | CC_MR_EWMA, | ||
| 57 | } predictor_type; | ||
| 58 | |||
| 59 | typedef struct predictor | ||
| 60 | { | ||
| 61 | predictor_type type; | ||
| 62 | uint16_t window_size; | ||
| 63 | |||
| 64 | uint8_t sigmas; | ||
| 65 | uint16_t alpha_num; | ||
| 66 | uint16_t alpha_denom; | ||
| 67 | } predictor_t; | ||
| 68 | |||
| 69 | |||
| 44 | /* We use the common priority interpretation "lower index == higher priority", | 70 | /* We use the common priority interpretation "lower index == higher priority", |
| 45 | * which is commonly used in fixed-priority schedulability analysis papers. | 71 | * which is commonly used in fixed-priority schedulability analysis papers. |
| 46 | * So, a numerically lower priority value implies higher scheduling priority, | 72 | * So, a numerically lower priority value implies higher scheduling priority, |
| @@ -180,23 +206,48 @@ typedef enum gpu_migration_dist | |||
| 180 | MIG_LAST = MIG_NONE | 206 | MIG_LAST = MIG_NONE |
| 181 | } gpu_migration_dist_t; | 207 | } gpu_migration_dist_t; |
| 182 | 208 | ||
| 183 | typedef struct feedback_est{ | ||
| 184 | fp_t est; | ||
| 185 | fp_t accum_err; | ||
| 186 | } feedback_est_t; | ||
| 187 | |||
| 188 | |||
| 189 | #define AVG_EST_WINDOW_SIZE 20 | 209 | #define AVG_EST_WINDOW_SIZE 20 |
| 190 | 210 | ||
| 191 | typedef struct avg_est{ | 211 | typedef struct obs_history |
| 192 | lt_t history[AVG_EST_WINDOW_SIZE]; | 212 | { |
| 213 | uint16_t window_size; | ||
| 193 | uint16_t count; | 214 | uint16_t count; |
| 194 | uint16_t idx; | 215 | uint16_t idx; |
| 216 | uint16_t ridx; | ||
| 217 | |||
| 218 | lt_t last_observed; | ||
| 219 | lt_t *observations; | ||
| 220 | lt_t *range; | ||
| 221 | } obs_history_t; | ||
| 222 | |||
| 223 | typedef struct avg_est { | ||
| 224 | uint8_t sigmas; | ||
| 225 | |||
| 226 | obs_history_t history; | ||
| 227 | |||
| 195 | lt_t sum; | 228 | lt_t sum; |
| 229 | lt_t rsum; | ||
| 230 | |||
| 196 | lt_t std; | 231 | lt_t std; |
| 197 | lt_t avg; | 232 | lt_t center_line; |
| 198 | } avg_est_t; | 233 | } avg_est_t; |
| 199 | 234 | ||
| 235 | |||
| 236 | typedef struct ewma_est { | ||
| 237 | uint8_t sigmas; | ||
| 238 | uint16_t alpha_num; | ||
| 239 | uint16_t alpha_denom; | ||
| 240 | |||
| 241 | obs_history_t history; | ||
| 242 | |||
| 243 | lt_t rsum; | ||
| 244 | |||
| 245 | lt_t std; | ||
| 246 | lt_t center_line; | ||
| 247 | } ewma_est_t; | ||
| 248 | |||
| 249 | |||
| 250 | |||
| 200 | /* RT task parameters for scheduling extensions | 251 | /* RT task parameters for scheduling extensions |
| 201 | * These parameters are inherited during clone and therefore must | 252 | * These parameters are inherited during clone and therefore must |
| 202 | * be explicitly set up before the task set is launched. | 253 | * be explicitly set up before the task set is launched. |
| @@ -243,7 +294,13 @@ struct rt_param { | |||
| 243 | long unsigned int held_gpus; // bitmap of held GPUs. | 294 | long unsigned int held_gpus; // bitmap of held GPUs. |
| 244 | 295 | ||
| 245 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | 296 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING |
| 246 | avg_est_t gpu_migration_est[MIG_LAST+1]; | 297 | // avg_est_t gpu_migration_est[MIG_LAST+1]; |
| 298 | predictor_type prediction_mode; | ||
| 299 | union | ||
| 300 | { | ||
| 301 | avg_est_t gpu_avg_est[MIG_LAST+1]; | ||
| 302 | ewma_est_t gpu_ewma_est[MIG_LAST+1]; | ||
| 303 | }; | ||
| 247 | 304 | ||
| 248 | gpu_migration_dist_t gpu_migration; | 305 | gpu_migration_dist_t gpu_migration; |
| 249 | int last_gpu; | 306 | int last_gpu; |
