From e339f372a22d1d4586539bacdf60cf8bc8f0ec47 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 21 Oct 2010 14:13:03 -0400 Subject: [PATCH] Rx: Treat rx_minPeerTimeout not as a minimum but as padding An improved RTT and timeout calculation algorithm is being developed but until we have it, treat rx_minPeerTimeout not as a minimum value for the timeout but as padding to be added to the measured RTT when computing the peer timeout value. With this change rx does not begin to send large numbers of resends when the RTT begins to exceed the rx_minPeerTimeout value. Timeout triggered resends at the moment can force rx into fast recovery mode which in turn kills performance. It is better to avoid that problem for now. Reviewed-on: http://gerrit.openafs.org/3026 Reviewed-by: Derrick Brashear Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman (cherry picked from commit 5c8981e0404287f2aa46390d3a9e8a52261906ab) Change-Id: I82cf73cc8153d9aba669dc581231a88949b6ec4d Reviewed-on: http://gerrit.openafs.org/3126 Tested-by: Derrick Brashear --- src/rx/rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index eeb1a47c3..b5ed392a1 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -6522,11 +6522,11 @@ rxi_ComputeRoundTripTime(struct rx_packet *p, peer->rtt = _8THMSEC(rttp) + 8; peer->rtt_dev = peer->rtt >> 2; /* rtt/2: they're scaled differently */ } - /* the timeout is RTT + 4*MDEV but no less than rx_minPeerTimeout msec. + /* the timeout is RTT + 4*MDEV + rx_minPeerTimeout msec. * This is because one end or the other of these connections is usually * in a user process, and can be switched and/or swapped out. So on fast, * reliable networks, the timeout would otherwise be too short. */ - rtt_timeout = MAX(((peer->rtt >> 3) + peer->rtt_dev), rx_minPeerTimeout); + rtt_timeout = ((peer->rtt >> 3) + peer->rtt_dev) + rx_minPeerTimeout; clock_Zero(&(peer->timeout)); clock_Addmsec(&(peer->timeout), rtt_timeout); -- 2.39.5