/* *Calledtocomputeasmoothedrttestimate.Thedatafedtothis *routineeithercomesfromtimestamps,orfromsegmentsthatwere *known_not_tohavebeenretransmitted[seeKarn/Partridge *ProceedingsSIGCOMM87].ThealgorithmisfromtheSIGCOMM88 *piecebyVanJacobson. *NOTE:thenextthreeroutinesusedtobeonebigroutine. *TosavecyclesintheRFC1323implementationitwasbettertobreak *itupintothreeprocedures.--erics
*/ staticvoid rxrpc_rtt_estimator(struct rxrpc_call *call, long sample_rtt_us)
{ long m = sample_rtt_us; /* RTT */
u32 srtt = call->srtt_us;
/* The following amusing code comes from Jacobson's *articleinSIGCOMM'88.Notethatrttandmdev *arescaledversionsofrttandmeandeviation. *Thisisdesignedtobeasfastaspossible *mstandsfor"measurement". * *Ona1990paperthertovalueischangedto: *RTO=rtt+4*mdev * *Funny.Thisalgorithmseemstobeverybroken. *TheseformulaeincreaseRTO,whenitshouldbedecreased,increase *tooslowly,whenitshouldbeincreasedquickly,decreasetooquickly *etc.IguessinBSDRTOtakesONEvalue,sothatitisabsolutely *doesnotmatterhowto_calculate_it.Seems,itwastrap *thatVJfailedtoavoid.8)
*/ if (srtt != 0) {
m -= (srtt >> 3); /* m is now error in rtt est */
srtt += m; /* rtt = 7/8 rtt + 1/8 new */ if (m < 0) {
m = -m; /* m is now abs(error) */
m -= (call->mdev_us >> 2); /* similar update on mdev */ /* This is similar to one of Eifel findings. *Eifelblocksmdevupdateswhenrttdecreases. *Thissolutionisabitdifferent:weusefinergain *formdevinthiscase(alpha*beta). *LikeEifelitalsopreventsgrowthofrto, *butalsoitlimitstoofastrtodecreases, *happeninginpureEifel.
*/ if (m > 0)
m >>= 3;
} else {
m -= (call->mdev_us >> 2); /* similar update on mdev */
}
call->mdev_us += m; /* mdev = 3/4 mdev + 1/4 new */ if (call->mdev_us > call->mdev_max_us) {
call->mdev_max_us = call->mdev_us; if (call->mdev_max_us > call->rttvar_us)
call->rttvar_us = call->mdev_max_us;
}
} else { /* no previous measure. */
srtt = m << 3; /* take the measured time to be rtt */
call->mdev_us = m << 1; /* make sure rto = 3*rtt */
call->rttvar_us = umax(call->mdev_us, rxrpc_rto_min_us(call));
call->mdev_max_us = call->rttvar_us;
}
/* 1. If rtt variance happened to be less 50msec, it is hallucination. *ItcannotbelessduetoutterlyerraticACKgenerationmade *atleastbysolarisandfreebsd."ErraticACKs"has_nothing_ *todowithdelayedacks,becauseatcwnd>2truedelacktimeout *isinvisible.Actually,Linux-2.4alsogenerateserratic *ACKsinsomecircumstances.
*/
rto = __rxrpc_set_rto(call);
/* 2. Fixups made earlier cannot be right. *IfwedonotestimateRTOcorrectlywithoutthem, *allthealgoispureshitandshouldbereplaced *withcorrectone.Itisexactly,whichwepretendtodo.
*/
/* NOTE: clamping at RXRPC_RTO_MIN is not required, current algo *guaranteesthatrtoishigher.
*/
call->rto_us = rxrpc_bound_rto(rto);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.