diff options
author | Aaron Block <block@cs.unc.edu> | 2007-10-10 15:56:12 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-10 15:56:12 -0400 |
commit | 09e701c451833d82e0b805c19151f5f72d5be53a (patch) | |
tree | 8a31799ddfc1d01a21890338eae1df55958cf2ad /kernel | |
parent | f19eb937742f98096bb4d1d72af15459547e7c49 (diff) |
Changed the scheduling algorithms to include more usefull tags
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/edf_common.c | 1 | ||||
-rw-r--r-- | kernel/sched_adaptive.c | 25 | ||||
-rw-r--r-- | kernel/sched_trace.c | 1 |
3 files changed, 20 insertions, 7 deletions
diff --git a/kernel/edf_common.c b/kernel/edf_common.c index 16b589d3e7..4746c6642c 100644 --- a/kernel/edf_common.c +++ b/kernel/edf_common.c | |||
@@ -71,6 +71,7 @@ void edf_release_at(struct task_struct *t, jiffie_t start) | |||
71 | { | 71 | { |
72 | t->rt_param.times.deadline = start; | 72 | t->rt_param.times.deadline = start; |
73 | edf_prepare_for_next_period(t); | 73 | edf_prepare_for_next_period(t); |
74 | t->rt_param.times.last_release = start; | ||
74 | set_rt_flags(t, RT_F_RUNNING); | 75 | set_rt_flags(t, RT_F_RUNNING); |
75 | } | 76 | } |
76 | 77 | ||
diff --git a/kernel/sched_adaptive.c b/kernel/sched_adaptive.c index f78b4d848d..0d524cf258 100644 --- a/kernel/sched_adaptive.c +++ b/kernel/sched_adaptive.c | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | /* | 2 | /* |
2 | * kernel/sched_adaptive.c | 3 | * kernel/sched_adaptive.c |
3 | * | 4 | * |
@@ -203,11 +204,17 @@ static void update_weight_estimate(struct task_struct* t) | |||
203 | nw = t->rt_param.opt_nw; | 204 | nw = t->rt_param.opt_nw; |
204 | exec_time = t->rt_param.times.exec_time; | 205 | exec_time = t->rt_param.times.exec_time; |
205 | sl_period = get_sl(t, get_opt_sl(t)).period; | 206 | sl_period = get_sl(t, get_opt_sl(t)).period; |
206 | 207 | ||
207 | t->rt_param.predictor_state.estimate = | 208 | /*TRACE("ow=" _FP_ " nw=" _FP_ ", r-d " _FP_ ", deadline %d, release %d, exec_time=%ld sl_period=%lu\n", |
208 | _div( _max(_mul(nw, FP(sl_period)), FP(exec_time)), | 209 | fp2str(ow), fp2str(nw),fp2str(FP(get_deadline(t)-get_last_release(t))), get_deadline(t), get_last_release(t), exec_time, sl_period);*/ |
209 | FP(get_deadline(t) - get_last_release(t))); | 210 | |
210 | TRACE_TASK(t, " update_weight_estimate: " _FP_ " => " _FP_ "\n", ow, get_est_weight(t)); | 211 | t->rt_param.predictor_state.estimate = nw; |
212 | TRACE_TASK(t, "AAAupdate_weight_estimate from " _FP_ " to "_FP_"\n", fp2str(ow), fp2str(nw)); | ||
213 | |||
214 | /*_div( _max(_mul(nw, FP(sl_period)), FP(exec_time)), | ||
215 | FP(get_deadline(t) - get_last_release(t))); | ||
216 | TRACE_TASK(t, " update_weight_estimate: " _FP_ " => " _FP_ "\n", | ||
217 | fp2str(ow), fp2str(get_est_weight(t)));*/ | ||
211 | } | 218 | } |
212 | 219 | ||
213 | 220 | ||
@@ -364,8 +371,12 @@ void adaptive_optimize(void) | |||
364 | * also account for weight. | 371 | * also account for weight. |
365 | * Also establish current estimated utilization | 372 | * Also establish current estimated utilization |
366 | */ | 373 | */ |
367 | list_for_each(p, &list) { | 374 | list_for_each_safe(p, extra, &list) { |
368 | t = list_entry(p, struct task_struct, rt_param.opt_list); | 375 | t = list_entry(p, struct task_struct, rt_param.opt_list); |
376 | if (time_before(opt_time, get_last_release(t))) { | ||
377 | list_del(p); | ||
378 | continue; | ||
379 | } | ||
369 | t->rt_param.opt_order = linear_metric(t); | 380 | t->rt_param.opt_order = linear_metric(t); |
370 | TRACE_TASK(t, "est_w = " _FP_ " L = " _FP_ "\n", | 381 | TRACE_TASK(t, "est_w = " _FP_ " L = " _FP_ "\n", |
371 | get_est_weight(t), | 382 | get_est_weight(t), |
@@ -1106,7 +1117,7 @@ sched_plugin_t *__init init_adaptive_plugin(void) | |||
1106 | 1117 | ||
1107 | /* magic values given in the paper */ | 1118 | /* magic values given in the paper */ |
1108 | fc_a = _frac( 102, 1000); | 1119 | fc_a = _frac( 102, 1000); |
1109 | fc_b = _frac(-1975, 1000); | 1120 | fc_b = _frac( 303, 1000); |
1110 | 1121 | ||
1111 | optimizer_period = 1000; | 1122 | optimizer_period = 1000; |
1112 | task_error_threshold = _frac(1, 2); | 1123 | task_error_threshold = _frac(1, 2); |
diff --git a/kernel/sched_trace.c b/kernel/sched_trace.c index bbaf26ba10..d41c6e6b74 100644 --- a/kernel/sched_trace.c +++ b/kernel/sched_trace.c | |||
@@ -635,6 +635,7 @@ void sched_trace_job_completion(struct task_struct *t) | |||
635 | tinfo(rec.task, t); | 635 | tinfo(rec.task, t); |
636 | rtinfo(rec, t); | 636 | rtinfo(rec, t); |
637 | rec.tardiness = jiffies - t->rt_param.times.deadline; | 637 | rec.tardiness = jiffies - t->rt_param.times.deadline; |
638 | TRACE_TASK(t, "AAATardiness : %d\n", rec.tardiness); | ||
638 | put_trace(rec); | 639 | put_trace(rec); |
639 | } | 640 | } |
640 | 641 | ||