android_kernel_xiaomi_sm7250/net/sunrpc
Chuck Lever b22602a673 SUNRPC: Ensure all transports set rq_xtime consistently
The RPC client uses the rq_xtime field in each RPC request to determine the
round-trip time of the request.  Currently, the rq_xtime field is
initialized by each transport just before it starts enqueing a request to
be sent.  However, transports do not handle initializing this value
consistently; sometimes they don't initialize it at all.

To make the measurement of request round-trip time consistent for all
RPC client transport capabilities, pull rq_xtime initialization into the
RPC client's generic transport logic.  Now all transports will get a
standardized RTT measure automatically, from:

  xprt_transmit()

to

  xprt_complete_rqst()

This makes round-trip time calculation more accurate for the TCP transport.
The socket ->sendmsg() method can return "-EAGAIN" if the socket's output
buffer is full, so the TCP transport's ->send_request() method may call
the ->sendmsg() method repeatedly until it gets all of the request's bytes
queued in the socket's buffer.

Currently, the TCP transport sets the rq_xtime field every time through
that loop so the final value is the timestamp just before the *last* call
to the underlying socket's ->sendmsg() method.  After this patch, the
rq_xtime field contains a timestamp that reflects the time just before the
*first* call to ->sendmsg().

This is consequential under heavy workloads because large requests often
take multiple ->sendmsg() calls to get all the bytes of a request queued.
The TCP transport causes the request to sleep until the remote end of the
socket has received enough bytes to clear space in the socket's local
output buffer.  This delay can be quite significant.

The method introduced by this patch is a more accurate measure of RTT
for stream transports, since the server can cause enough back pressure
to delay (ie increase the latency of) requests from the client.

Additionally, this patch corrects the behavior of the RDMA transport, which
entirely neglected to initialize the rq_xtime field.  RPC performance
metrics for RDMA transports now display correct RPC request round trip
times.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Tom Talpey <thomas.talpey@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2008-07-09 12:09:15 -04:00
..
auth_gss rpc: remove some unused macros 2008-07-09 12:09:12 -04:00
xprtrdma svcrdma: Verify read-list fits within RPCSVC_MAXPAGES 2008-05-19 07:34:02 -05:00
auth_generic.c SUNRPC: AUTH_SYS "machine creds" shouldn't use negative valued uid/gid 2008-05-18 14:18:27 -04:00
auth_null.c NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid() 2008-04-19 16:54:53 -04:00
auth_unix.c SUNRPC: Use GFP_NOFS when allocating credentials 2008-07-09 12:08:48 -04:00
auth.c SUNRPC: Protect creds against early garbage collection 2008-04-19 16:55:02 -04:00
cache.c sunrpc: assign PDE->data before gluing PDE into /proc tree 2008-05-02 02:44:36 -07:00
clnt.c rpc: bring back cl_chatty 2008-07-09 12:09:10 -04:00
Makefile SUNRPC: Add a generic RPC credential 2008-03-14 13:42:38 -04:00
rpc_pipe.c net: replace remaining __FUNCTION__ occurrences 2008-03-05 20:47:47 -08:00
rpcb_clnt.c SUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups 2008-07-08 15:23:10 -04:00
sched.c rpc: minor cleanup of scheduler callback code 2008-07-09 12:09:14 -04:00
socklib.c SUNRPC: temp var should match return type of xdr_skb_read_actor 2008-01-30 02:05:43 -05:00
stats.c sunrpc: assign PDE->data before gluing PDE into /proc tree 2008-05-02 02:44:36 -07:00
sunrpc_syms.c SUNRPC: Move exported symbol definitions after function declaration part 2 2008-02-01 17:01:24 -05:00
svc_xprt.c svc: Remove unused header files from svc_xprt.c 2008-05-19 07:33:42 -05:00
svc.c Remove duplicated include in net/sunrpc/svc.c 2008-05-08 10:58:25 -07:00
svcauth_unix.c svcrpc: fix proc/net/rpc/auth.unix.ip/content display 2008-05-18 19:13:07 -04:00
svcauth.c SUNRPC: Move exported symbol definitions after function declaration part 2 2008-02-01 17:01:24 -05:00
svcsock.c SUNRPC: Update RPC server's TCP record marker decoder 2008-04-23 16:13:43 -04:00
sysctl.c svc: Add /proc/sys/sunrpc/transport files 2008-02-01 16:42:13 -05:00
timer.c SUNRPC: add EXPORT_SYMBOL_GPL for generic transport functions 2007-10-09 17:17:36 -04:00
xdr.c SUNRPC: don't call flush_dcache_page() with an invalid pointer 2008-04-08 21:06:50 -04:00
xprt.c SUNRPC: Ensure all transports set rq_xtime consistently 2008-07-09 12:09:15 -04:00
xprtsock.c SUNRPC: Ensure all transports set rq_xtime consistently 2008-07-09 12:09:15 -04:00