aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/litmus/gpu_affinity.h15
-rw-r--r--include/litmus/rt_param.h15
2 files changed, 20 insertions, 10 deletions
diff --git a/include/litmus/gpu_affinity.h b/include/litmus/gpu_affinity.h
index 6b3fb8b28745..d64a15cbf2a5 100644
--- a/include/litmus/gpu_affinity.h
+++ b/include/litmus/gpu_affinity.h
@@ -31,17 +31,18 @@ static inline lt_t get_gpu_time(struct task_struct* t)
31 31
32static inline lt_t get_gpu_estimate(struct task_struct* t, gpu_migration_dist_t dist) 32static inline lt_t get_gpu_estimate(struct task_struct* t, gpu_migration_dist_t dist)
33{ 33{
34 int i; 34// int i;
35 fpbuf_t temp = _fp_to_integer(t->rt_param.gpu_migration_est[dist].est); 35// fpbuf_t temp = _fp_to_integer(t->rt_param.gpu_migration_est[dist].est);
36 lt_t val = (temp >= 0) ? temp : 0; // never allow negative estimates... 36// lt_t val = (temp >= 0) ? temp : 0; // never allow negative estimates...
37 lt_t val = t->rt_param.gpu_migration_est[dist].avg;
37 38
38 WARN_ON(temp < 0); 39// WARN_ON(temp < 0);
39 40
40 // lower-bound a distant migration to be at least equal to the level 41 // lower-bound a distant migration to be at least equal to the level
41 // below it. 42 // below it.
42 for(i = dist-1; (val == 0) && (i >= MIG_LOCAL); --i) { 43// for(i = dist-1; (val == 0) && (i >= MIG_LOCAL); --i) {
43 val = _fp_to_integer(t->rt_param.gpu_migration_est[i].est); 44// val = _fp_to_integer(t->rt_param.gpu_migration_est[i].est);
44 } 45// }
45 46
46 return ((val > 0) ? val : dist+1); 47 return ((val > 0) ? val : dist+1);
47} 48}
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 0198884eab86..a441badd30cc 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -144,6 +144,17 @@ typedef struct feedback_est{
144 fp_t accum_err; 144 fp_t accum_err;
145} feedback_est_t; 145} feedback_est_t;
146 146
147
148#define AVG_EST_WINDOW_SIZE 20
149
150typedef struct avg_est{
151 lt_t history[AVG_EST_WINDOW_SIZE];
152 uint16_t count;
153 uint16_t idx;
154 lt_t sum;
155 lt_t avg;
156} avg_est_t;
157
147/* RT task parameters for scheduling extensions 158/* RT task parameters for scheduling extensions
148 * These parameters are inherited during clone and therefore must 159 * These parameters are inherited during clone and therefore must
149 * be explicitly set up before the task set is launched. 160 * be explicitly set up before the task set is launched.
@@ -190,12 +201,10 @@ struct rt_param {
190 long unsigned int held_gpus; // bitmap of held GPUs. 201 long unsigned int held_gpus; // bitmap of held GPUs.
191 202
192#ifdef CONFIG_LITMUS_AFFINITY_LOCKING 203#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
193 fp_t gpu_fb_param_a[MIG_LAST+1]; 204 avg_est_t gpu_migration_est[MIG_LAST+1];
194 fp_t gpu_fb_param_b[MIG_LAST+1];
195 205
196 gpu_migration_dist_t gpu_migration; 206 gpu_migration_dist_t gpu_migration;
197 int last_gpu; 207 int last_gpu;
198 feedback_est_t gpu_migration_est[MIG_LAST+1]; // local, near, med, far
199 208
200 lt_t accum_gpu_time; 209 lt_t accum_gpu_time;
201 lt_t gpu_time_stamp; 210 lt_t gpu_time_stamp;