216,43 → 216,44 |
#ifdef ELASTIC_DEBUG |
cprintf("ELASTIC_compress: Task set feasible with maximum utilizations\n"); |
#endif |
return 0; // FEASIBLE WITH MAXIMUM UTILIZATIONS |
} |
|
do { |
Uf = 0; |
Ev = 0; |
Umax = 0; |
} else { |
|
for (i=0; i<MAX_PROC; i++) { |
et = &lev->elist[i]; |
if (et->flags & ELASTIC_PRESENT) { |
if (et->E == 0 || et->U == et->Umin) { |
Uf += et->U; |
} else { |
Ev += et->E; |
Umax += et->Umax; |
do { |
Uf = 0; |
Ev = 0; |
Umax = 0; |
|
for (i=0; i<MAX_PROC; i++) { |
et = &lev->elist[i]; |
if (et->flags & ELASTIC_PRESENT) { |
if (et->E == 0 || et->U == et->Umin) { |
Uf += et->U; |
} else { |
Ev += et->E; |
Umax += et->Umax; |
} |
} |
} |
} |
|
ok = 1; |
|
for (i=0; i<MAX_PROC; i++) { |
et = &lev->elist[i]; |
if (et->flags & ELASTIC_PRESENT) { |
if (et->E > 0 && et->U > et->Umin) { |
et->U = et->Umax - (Umax - lev->U + Uf) * et->E / Ev; |
if (et->U < et->Umin) { |
et->U = et->Umin; |
ok = 0; |
|
ok = 1; |
|
for (i=0; i<MAX_PROC; i++) { |
et = &lev->elist[i]; |
if (et->flags & ELASTIC_PRESENT) { |
if (et->E > 0 && et->U > et->Umin) { |
et->U = et->Umax - (Umax - lev->U + Uf) * et->E / Ev; |
if (et->U < et->Umin) { |
et->U = et->Umin; |
ok = 0; |
} |
} |
} |
} |
} |
|
} while (ok == 0); |
} |
|
} while (ok == 0); |
|
// Increase periods of compressed tasks IMMEDIATELY. |
// The other ones will be changed at their next activation |
|
499,7 → 500,7 |
ELASTIC_task_descr *et = &lev->elist[p]; |
|
if (et->dltimer != -1) { |
kern_event_delete(et->dltimer); |
kern_event_delete(et->dltimer); |
} |
|
if (et->flags & ELASTIC_JOB_PRESENT) { |
508,6 → 509,9 |
et->flags &= ~ELASTIC_JOB_PRESENT; |
} |
|
et->flags &= ~ELASTIC_PRESENT; |
|
ELASTIC_compress(lev); // Tasks may want to expand |
} |
|
/*+ Registration function +*/ |