]> git.hungrycats.org Git - linux/commitdiff
Increase the minimum RTO timer value to 1/10 second. This is more
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 21 Aug 2003 11:33:03 +0000 (04:33 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 21 Aug 2003 11:33:03 +0000 (04:33 -0700)
in line with what is done for TCP.

Signedness corrections when updating RTT.

Be conservative when calculating RTO. Round up the residues.

net/sunrpc/timer.c

index bf32f588ecd804291c9e2c60a05abcf744d4da91..a84e3e2b298f30239e16a8f4750d0f9640652a51 100644 (file)
@@ -25,7 +25,7 @@
 
 #define RPC_RTO_MAX (60*HZ)
 #define RPC_RTO_INIT (HZ/5)
-#define RPC_RTO_MIN (2)
+#define RPC_RTO_MIN (HZ/10)
 
 void
 rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
@@ -50,7 +50,7 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
 void
 rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
 {
-       unsigned long *srtt, *sdrtt;
+       long *srtt, *sdrtt;
 
        if (timer-- == 0)
                return;
@@ -62,14 +62,14 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
        if (m == 0)
                m = 1L;
 
-       srtt = &rt->srtt[timer];
+       srtt = (long *)&rt->srtt[timer];
        m -= *srtt >> 3;
        *srtt += m;
 
        if (m < 0)
                m = -m;
 
-       sdrtt = &rt->sdrtt[timer];
+       sdrtt = (long *)&rt->sdrtt[timer];
        m -= *sdrtt >> 2;
        *sdrtt += m;
 
@@ -99,7 +99,7 @@ rpc_calc_rto(struct rpc_rtt *rt, unsigned timer)
        if (timer-- == 0)
                return rt->timeo;
 
-       res = (rt->srtt[timer] >> 3) + rt->sdrtt[timer];
+       res = ((rt->srtt[timer] + 7) >> 3) + rt->sdrtt[timer];
        if (res > RPC_RTO_MAX)
                res = RPC_RTO_MAX;