Commit c05988cd authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

SUNRPC: Add documenting comments in net/sunrpc/timer.c

Clean up: provide documenting comments for the functions in
net/sunrpc/timer.c.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9dc3b095
...@@ -25,8 +25,13 @@ ...@@ -25,8 +25,13 @@
#define RPC_RTO_INIT (HZ/5) #define RPC_RTO_INIT (HZ/5)
#define RPC_RTO_MIN (HZ/10) #define RPC_RTO_MIN (HZ/10)
void /**
rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) * rpc_init_rtt - Initialize an RPC RTT estimator context
* @rt: context to initialize
* @timeo: initial timeout value, in jiffies
*
*/
void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
{ {
unsigned long init = 0; unsigned long init = 0;
unsigned i; unsigned i;
...@@ -43,12 +48,16 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) ...@@ -43,12 +48,16 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
} }
EXPORT_SYMBOL_GPL(rpc_init_rtt); EXPORT_SYMBOL_GPL(rpc_init_rtt);
/* /**
* rpc_update_rtt - Update an RPC RTT estimator context
* @rt: context to update
* @timer: timer array index (request type)
* @m: recent actual RTT, in jiffies
*
* NB: When computing the smoothed RTT and standard deviation, * NB: When computing the smoothed RTT and standard deviation,
* be careful not to produce negative intermediate results. * be careful not to produce negative intermediate results.
*/ */
void void rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
{ {
long *srtt, *sdrtt; long *srtt, *sdrtt;
...@@ -79,21 +88,25 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m) ...@@ -79,21 +88,25 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
} }
EXPORT_SYMBOL_GPL(rpc_update_rtt); EXPORT_SYMBOL_GPL(rpc_update_rtt);
/* /**
* Estimate rto for an nfs rpc sent via. an unreliable datagram. * rpc_calc_rto - Provide an estimated timeout value
* Use the mean and mean deviation of rtt for the appropriate type of rpc * @rt: context to use for calculation
* for the frequent rpcs and a default for the others. * @timer: timer array index (request type)
* The justification for doing "other" this way is that these rpcs *
* happen so infrequently that timer est. would probably be stale. * Estimate RTO for an NFS RPC sent via an unreliable datagram. Use
* Also, since many of these rpcs are * the mean and mean deviation of RTT for the appropriate type of RPC
* non-idempotent, a conservative timeout is desired. * for frequently issued RPCs, and a fixed default for the others.
*
* The justification for doing "other" this way is that these RPCs
* happen so infrequently that timer estimation would probably be
* stale. Also, since many of these RPCs are non-idempotent, a
* conservative timeout is desired.
*
* getattr, lookup, * getattr, lookup,
* read, write, commit - A+4D * read, write, commit - A+4D
* other - timeo * other - timeo
*/ */
unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned timer)
unsigned long
rpc_calc_rto(struct rpc_rtt *rt, unsigned timer)
{ {
unsigned long res; unsigned long res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment