diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-13 12:51:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:36 -0400 |
commit | d60dbb20a74c2cfa142be0a34dac3c6547ea086c (patch) | |
tree | 7af95739f8fbbef11f490b5b58bf639dbbe8a181 | |
parent | 9c7e7e23371e629dbb3b341610a418cdf1c19d91 (diff) |
SUNRPC: Move the task->tk_bytes_sent and tk_rtt to struct rpc_rqst
It seems strange to maintain stats for bytes_sent in one structure, and
bytes received in another. Try to assemble all the RPC request-related
stats in struct rpc_rqst
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | include/linux/sunrpc/sched.h | 4 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 6 | ||||
-rw-r--r-- | net/sunrpc/stats.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 76720d262ef2..46ebef1788c6 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -80,9 +80,7 @@ struct rpc_task { | |||
80 | } u; | 80 | } u; |
81 | 81 | ||
82 | unsigned short tk_timeouts; /* maj timeouts */ | 82 | unsigned short tk_timeouts; /* maj timeouts */ |
83 | size_t tk_bytes_sent; /* total bytes sent */ | 83 | ktime_t tk_start; /* RPC task init timestamp */ |
84 | ktime_t tk_start, /* RPC task init timestamp */ | ||
85 | tk_rtt; /* round-trip time */ | ||
86 | 84 | ||
87 | pid_t tk_owner; /* Process id for batching tasks */ | 85 | pid_t tk_owner; /* Process id for batching tasks */ |
88 | unsigned char tk_priority : 2;/* Task priority */ | 86 | unsigned char tk_priority : 2;/* Task priority */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index f8851861b744..b51470302399 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -66,8 +66,6 @@ struct rpc_rqst { | |||
66 | struct rpc_task * rq_task; /* RPC task data */ | 66 | struct rpc_task * rq_task; /* RPC task data */ |
67 | __be32 rq_xid; /* request XID */ | 67 | __be32 rq_xid; /* request XID */ |
68 | int rq_cong; /* has incremented xprt->cong */ | 68 | int rq_cong; /* has incremented xprt->cong */ |
69 | int rq_reply_bytes_recvd; /* number of reply */ | ||
70 | /* bytes received */ | ||
71 | u32 rq_seqno; /* gss seq no. used on req. */ | 69 | u32 rq_seqno; /* gss seq no. used on req. */ |
72 | int rq_enc_pages_num; | 70 | int rq_enc_pages_num; |
73 | struct page **rq_enc_pages; /* scratch pages for use by | 71 | struct page **rq_enc_pages; /* scratch pages for use by |
@@ -78,12 +76,16 @@ struct rpc_rqst { | |||
78 | __u32 * rq_buffer; /* XDR encode buffer */ | 76 | __u32 * rq_buffer; /* XDR encode buffer */ |
79 | size_t rq_callsize, | 77 | size_t rq_callsize, |
80 | rq_rcvsize; | 78 | rq_rcvsize; |
79 | size_t rq_xmit_bytes_sent; /* total bytes sent */ | ||
80 | size_t rq_reply_bytes_recvd; /* total reply bytes */ | ||
81 | /* received */ | ||
81 | 82 | ||
82 | struct xdr_buf rq_private_buf; /* The receive buffer | 83 | struct xdr_buf rq_private_buf; /* The receive buffer |
83 | * used in the softirq. | 84 | * used in the softirq. |
84 | */ | 85 | */ |
85 | unsigned long rq_majortimeo; /* major timeout alarm */ | 86 | unsigned long rq_majortimeo; /* major timeout alarm */ |
86 | unsigned long rq_timeout; /* Current timeout value */ | 87 | unsigned long rq_timeout; /* Current timeout value */ |
88 | ktime_t rq_rtt; /* round-trip time */ | ||
87 | unsigned int rq_retries; /* # of retries */ | 89 | unsigned int rq_retries; /* # of retries */ |
88 | unsigned int rq_connect_cookie; | 90 | unsigned int rq_connect_cookie; |
89 | /* A cookie used to track the | 91 | /* A cookie used to track the |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index aacd95f0dce5..ea1046f3f9a3 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -156,13 +156,13 @@ void rpc_count_iostats(struct rpc_task *task) | |||
156 | op_metrics->om_ntrans += req->rq_ntrans; | 156 | op_metrics->om_ntrans += req->rq_ntrans; |
157 | op_metrics->om_timeouts += task->tk_timeouts; | 157 | op_metrics->om_timeouts += task->tk_timeouts; |
158 | 158 | ||
159 | op_metrics->om_bytes_sent += task->tk_bytes_sent; | 159 | op_metrics->om_bytes_sent += req->rq_xmit_bytes_sent; |
160 | op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd; | 160 | op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd; |
161 | 161 | ||
162 | delta = ktime_sub(req->rq_xtime, task->tk_start); | 162 | delta = ktime_sub(req->rq_xtime, task->tk_start); |
163 | op_metrics->om_queue = ktime_add(op_metrics->om_queue, delta); | 163 | op_metrics->om_queue = ktime_add(op_metrics->om_queue, delta); |
164 | 164 | ||
165 | op_metrics->om_rtt = ktime_add(op_metrics->om_rtt, task->tk_rtt); | 165 | op_metrics->om_rtt = ktime_add(op_metrics->om_rtt, req->rq_rtt); |
166 | 166 | ||
167 | delta = ktime_sub(ktime_get(), task->tk_start); | 167 | delta = ktime_sub(ktime_get(), task->tk_start); |
168 | op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta); | 168 | op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 8986b1b82862..65fe2e4e7cbf 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -780,7 +780,7 @@ static void xprt_update_rtt(struct rpc_task *task) | |||
780 | struct rpc_rqst *req = task->tk_rqstp; | 780 | struct rpc_rqst *req = task->tk_rqstp; |
781 | struct rpc_rtt *rtt = task->tk_client->cl_rtt; | 781 | struct rpc_rtt *rtt = task->tk_client->cl_rtt; |
782 | unsigned timer = task->tk_msg.rpc_proc->p_timer; | 782 | unsigned timer = task->tk_msg.rpc_proc->p_timer; |
783 | long m = usecs_to_jiffies(ktime_to_us(task->tk_rtt)); | 783 | long m = usecs_to_jiffies(ktime_to_us(req->rq_rtt)); |
784 | 784 | ||
785 | if (timer) { | 785 | if (timer) { |
786 | if (req->rq_ntrans == 1) | 786 | if (req->rq_ntrans == 1) |
@@ -805,7 +805,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied) | |||
805 | task->tk_pid, ntohl(req->rq_xid), copied); | 805 | task->tk_pid, ntohl(req->rq_xid), copied); |
806 | 806 | ||
807 | xprt->stat.recvs++; | 807 | xprt->stat.recvs++; |
808 | task->tk_rtt = ktime_sub(ktime_get(), req->rq_xtime); | 808 | req->rq_rtt = ktime_sub(ktime_get(), req->rq_xtime); |
809 | if (xprt->ops->timer != NULL) | 809 | if (xprt->ops->timer != NULL) |
810 | xprt_update_rtt(task); | 810 | xprt_update_rtt(task); |
811 | 811 | ||
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 3f3b38c5642f..a85e866a77f7 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -674,7 +674,7 @@ xprt_rdma_send_request(struct rpc_task *task) | |||
674 | if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) | 674 | if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) |
675 | goto drop_connection; | 675 | goto drop_connection; |
676 | 676 | ||
677 | task->tk_bytes_sent += rqst->rq_snd_buf.len; | 677 | rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len; |
678 | rqst->rq_bytes_sent = 0; | 678 | rqst->rq_bytes_sent = 0; |
679 | return 0; | 679 | return 0; |
680 | 680 | ||
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index beefa7a3a90e..02fc7f04dd17 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -528,7 +528,7 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
528 | xdr->len - req->rq_bytes_sent, status); | 528 | xdr->len - req->rq_bytes_sent, status); |
529 | 529 | ||
530 | if (status >= 0) { | 530 | if (status >= 0) { |
531 | task->tk_bytes_sent += status; | 531 | req->rq_xmit_bytes_sent += status; |
532 | if (status >= req->rq_slen) | 532 | if (status >= req->rq_slen) |
533 | return 0; | 533 | return 0; |
534 | /* Still some bytes left; set up for a retry later. */ | 534 | /* Still some bytes left; set up for a retry later. */ |
@@ -624,7 +624,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
624 | /* If we've sent the entire packet, immediately | 624 | /* If we've sent the entire packet, immediately |
625 | * reset the count of bytes sent. */ | 625 | * reset the count of bytes sent. */ |
626 | req->rq_bytes_sent += status; | 626 | req->rq_bytes_sent += status; |
627 | task->tk_bytes_sent += status; | 627 | req->rq_xmit_bytes_sent += status; |
628 | if (likely(req->rq_bytes_sent >= req->rq_slen)) { | 628 | if (likely(req->rq_bytes_sent >= req->rq_slen)) { |
629 | req->rq_bytes_sent = 0; | 629 | req->rq_bytes_sent = 0; |
630 | return 0; | 630 | return 0; |