57,6 → 57,7 |
|
struct timespec dline; /* deadline */ |
struct timespec replenish; /* server period */ |
struct timespec vtimer_istant; /* timer of virtual time arrive */ |
int replenish_timer; |
int vtimer; |
int avail; /* current budget */ |
225,14 → 226,15 |
|
TRACER_LOGEVENT(FTrace_EVT_server_active,0,(unsigned int)b); |
|
if (b->vtimer!=NIL) kern_event_delete(b->vtimer); |
if (b->vtimer!=NIL) { |
kern_event_delete(b->vtimer); |
TIMESPEC_ASSIGN(acttime, &b->vtimer_istant); |
} |
b->vtimer=NIL; |
|
SUBTIMESPEC(&b->dline, acttime, &t2); |
if (/* 1 */ TIMESPEC_A_LT_B(&b->dline, acttime) || |
/* 2 */ TIMESPEC_A_GT_B(&t3, &t2) ) { |
|
if (b->negotiation) { |
//SUBTIMESPEC(&b->dline, acttime, &t2); |
//if (/* 1 */ TIMESPEC_A_LT_B(&b->dline, acttime) || |
// /* 2 */ TIMESPEC_A_GT_B(&t3, &t2) ) { |
if (b->negotiation) { |
lev->negotiation_in_progress--; |
b->negotiation=0; |
b->Q=b->N_Q; |
242,15 → 244,15 |
b->N_Q=0; |
b->N_T=0; |
b->N_D=0; |
} |
TIMESPEC_ASSIGN(&b->replenish, acttime); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
TIMESPEC_ASSIGN(&b->dline, acttime); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
b->avail = b->Q; |
b->last_reclaiming = 0; |
} |
|
TIMESPEC_ASSIGN(&b->replenish, acttime); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
TIMESPEC_ASSIGN(&b->dline, acttime); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
b->avail = b->Q; |
b->last_reclaiming = 0; |
//} |
|
if (b->flags==GRUBSTAR_RECLAIMING) |
if (lev->Uf < lev->U) lev->Uf += b->Ub; |
|
313,6 → 315,7 |
t3.tv_sec = t / 1000000; |
t3.tv_nsec = (t % 1000000) * 1000; |
SUBTIMESPEC(&b->dline, &t3, &t2); |
TIMESPEC_ASSIGN(&b->vtimer_istant , &t2); |
b->vtimer = kern_event_post(&t2, GRUBSTAR_ANC, b); |
} |
} |
419,10 → 422,8 |
#ifdef GRUBSTAR_DEBUG |
kern_printf("(GS:PriIns:%d:%d", p, budget->b); |
#endif |
|
if (budget->b == -1) |
return; |
|
lev->tb[p] = budget->b; |
|
if (lev->b[budget->b].current == NIL && lev->b[budget->b].flags ) { |
451,7 → 452,6 |
#ifdef GRUBSTAR_DEBUG |
kern_printf("(GS:Ext:%d)", p); |
#endif |
|
/* a task is removed from execution for some reasons. It must be |
that it is the first in its budget queue (only the first task in |
a budget queue is put into execution!) */ |
518,8 → 518,9 |
cprintf("GRUBSTAR Error: Bad Reclaiming Computation\n"); |
kern_raise(XUNSPECIFIED_EXCEPTION, exec_shadow); |
} |
|
|
mul32div32to32(lev->b[lev->tb[exec]].avail,(lev->U-lev->Uf),lev->U,lev->b[lev->tb[exec]].last_reclaiming); |
|
|
if (lev->b[lev->tb[exec]].last_reclaiming > 0) |
TRACER_LOGEVENT(FTrace_EVT_server_using_rec,(unsigned short int)lev->b[lev->tb[exec]].last_reclaiming,(unsigned int)(&lev->b[lev->tb[exec]])); |
653,6 → 654,7 |
lev->b[i].Ub = 0; |
NULL_TIMESPEC(&lev->b[i].dline); |
NULL_TIMESPEC(&lev->b[i].replenish); |
NULL_TIMESPEC(&lev->b[i].vtimer_istant); |
lev->b[i].replenish_timer = NIL; |
lev->b[i].vtimer = NIL; |
lev->b[i].avail = 0; |
760,7 → 762,7 |
lev->b[budget].current = -1; |
lev->b[budget].flags = GRUBSTAR_RECLAIMING; |
lev->b[budget].last_reclaiming = 0; |
lev->b[budget].loc_sched_level; |
lev->b[budget].loc_sched_level = -1; |
|
return 0; |
|
785,7 → 787,7 |
lev->b[budget].N_T = T; |
lev->b[budget].N_D = D; |
|
if (lev->b[budget].current!=NIL && !(lev->b[budget].Q==Q && lev->b[budget].T==T)) { |
if (0 && lev->b[budget].current!=NIL && !(lev->b[budget].Q==Q && lev->b[budget].T==T)) { |
lev->b[budget].N_Q = Q; |
lev->b[budget].N_T = T; |
lev->b[budget].N_D = D; |