105,9 → 105,14 |
b->avail += b->Q; |
if (b->avail > b->Q) b->avail = b->Q; |
|
if (b->flags==GRUBSTAR_RECLAIMING && b->avail>0) |
lev->Uf += b->Ub; |
if (b->flags==GRUBSTAR_RECLAIMING && b->avail>0) { |
lev->Uf += b->Ub; |
|
#ifdef GRUBSTAR_DEBUG |
kern_printf("BW=%ld, U=%u, Uf=%u",(long)bw, lev->U, lev->Uf); |
#endif |
} |
|
if (b->avail > 0) b->flags = GRUBSTAR_ACTIVE; |
|
if (b->current == NIL && b->flags) { |
163,7 → 168,7 |
lev->Uf -= b->Ub; |
|
#ifdef GRUBSTAR_DEBUG |
kern_printf("U=%u, Uf=%u",lev->U, lev->Uf); |
kern_printf("bw=%ld, U=%u, Uf=%u",(long)bw, lev->U, lev->Uf); |
#endif |
|
} |
197,13 → 202,21 |
TIMESPEC_ASSIGN(&b->dline, acttime); |
ADDUSEC2TIMESPEC(b->T, &b->dline); |
b->avail=b->Q; |
|
} |
|
if (b->flags==GRUBSTAR_RECLAIMING) |
if (b->flags==GRUBSTAR_RECLAIMING) { |
lev->Uf += b->Ub; |
|
#ifdef grubSTAR_DEBUG |
kern_printf("BW=%ld, U=%u, Uf=%u",(long)bw, lev->U, lev->Uf); |
#endif |
|
} |
|
b->flags=GRUBSTAR_ACTIVE; |
|
|
/* record the current task inserted in the master module */ |
b->current = p; |
|
233,6 → 246,9 |
|
SUBTIMESPEC(&schedule_time, &cap_lasttime, &ty); |
tx = TIMESPEC2USEC(&ty); |
#ifdef GRUBSTAR_DEBUG |
kern_printf("(GS:Cap p%d av=%d)", p, b->avail); |
#endif |
|
b->last_reclaiming = (unsigned int)((long long)(tx) * (long long)(lev->U - lev->Uf)/MAX_BANDWIDTH); |
|
239,7 → 255,7 |
b->avail -= tx - b->last_reclaiming; |
|
#ifdef GRUBSTAR_DEBUG |
kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u, tx=%d)", p, b->avail, lev->Uf, lev->U,(int)tx); |
kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u, tx=%d)", p, b->avail,lev->Uf, lev->U,(int)tx); |
#endif |
|
if (b->avail <= 0) b->flags = GRUBSTAR_NOACTIVE; |