aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2012-02-14 16:19:18 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-16 14:55:27 -0500
commit15a4520621824a3c2eb2de2d1f3984bc1663d3c8 (patch)
tree0ff258cf98774c72793ece98f2605f3fe132e352 /net/sunrpc/xprt.c
parent1d96e80faff57b9eefa283b35716a384bbb3d5b3 (diff)
SUNRPC: add sending,pending queue and max slot to xprt stats
With static RPC slots, the xprt backlog queue stats were useful in showing when the transport (TCP) was starved by lack of RPC slots. The new dynamic RPC slot code, commit d9ba131d8f58c0d2ff5029e7002ab43f913b36f9, always provides an RPC slot and so only uses the xprt backlog queue when the tcp_max_slot_table_entries value has been hit or when an allocation error occurs. All requests are now placed on the xprt sending or pending queue which need to be monitored for debugging. The max_slot stat shows the maximum number of dynamic RPC slots reached which is useful when debugging performance issues. Add the new fields at the end of the mountstats xprt stanza so that mountstats outputs the previous correct values and ignores the new fields. Bump NFS_IOSTATS_VERS. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index efe5495ecf65..739df8a11382 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -885,7 +885,7 @@ void xprt_transmit(struct rpc_task *task)
885{ 885{
886 struct rpc_rqst *req = task->tk_rqstp; 886 struct rpc_rqst *req = task->tk_rqstp;
887 struct rpc_xprt *xprt = req->rq_xprt; 887 struct rpc_xprt *xprt = req->rq_xprt;
888 int status; 888 int status, numreqs;
889 889
890 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen); 890 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen);
891 891
@@ -922,9 +922,14 @@ void xprt_transmit(struct rpc_task *task)
922 922
923 xprt->ops->set_retrans_timeout(task); 923 xprt->ops->set_retrans_timeout(task);
924 924
925 numreqs = atomic_read(&xprt->num_reqs);
926 if (numreqs > xprt->stat.max_slots)
927 xprt->stat.max_slots = numreqs;
925 xprt->stat.sends++; 928 xprt->stat.sends++;
926 xprt->stat.req_u += xprt->stat.sends - xprt->stat.recvs; 929 xprt->stat.req_u += xprt->stat.sends - xprt->stat.recvs;
927 xprt->stat.bklog_u += xprt->backlog.qlen; 930 xprt->stat.bklog_u += xprt->backlog.qlen;
931 xprt->stat.sending_u += xprt->sending.qlen;
932 xprt->stat.pending_u += xprt->pending.qlen;
928 933
929 /* Don't race with disconnect */ 934 /* Don't race with disconnect */
930 if (!xprt_connected(xprt)) 935 if (!xprt_connected(xprt))