summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2019-05-23 16:13:48 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-06 14:54:51 -0400
commit9dfe52a95a60096fc12234383a19b0f436304418 (patch)
treed334968701acb6f7d0443b075e1c09ad82e5dc99
parent44942b4e457beda00981f616402a1a791e8c616e (diff)
SUNRPC: Move call to rpc_count_iostats before rpc_call_done
For diagnostic purposes, it would be useful to have an rpc_iostats metric of RPCs completing with tk_status < 0. Unfortunately, tk_status is reset inside the rpc_call_done functions for each operation, and the call to tally the per-op metrics comes after rpc_call_done. Refactor the call to rpc_count_iostat earlier in rpc_exit_task so we can count these RPCs completing in error. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r--net/sunrpc/sched.c5
-rw-r--r--net/sunrpc/xprt.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index a2c114812717..f8ea362fae91 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -23,6 +23,7 @@
23#include <linux/sched/mm.h> 23#include <linux/sched/mm.h>
24 24
25#include <linux/sunrpc/clnt.h> 25#include <linux/sunrpc/clnt.h>
26#include <linux/sunrpc/metrics.h>
26 27
27#include "sunrpc.h" 28#include "sunrpc.h"
28 29
@@ -832,6 +833,10 @@ rpc_reset_task_statistics(struct rpc_task *task)
832void rpc_exit_task(struct rpc_task *task) 833void rpc_exit_task(struct rpc_task *task)
833{ 834{
834 task->tk_action = NULL; 835 task->tk_action = NULL;
836 if (task->tk_ops->rpc_count_stats)
837 task->tk_ops->rpc_count_stats(task, task->tk_calldata);
838 else if (task->tk_client)
839 rpc_count_iostats(task, task->tk_client->cl_metrics);
835 if (task->tk_ops->rpc_call_done != NULL) { 840 if (task->tk_ops->rpc_call_done != NULL) {
836 task->tk_ops->rpc_call_done(task, task->tk_calldata); 841 task->tk_ops->rpc_call_done(task, task->tk_calldata);
837 if (task->tk_action != NULL) { 842 if (task->tk_action != NULL) {
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index f6c82b1651e7..ab6b4c729ca5 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1765,10 +1765,6 @@ void xprt_release(struct rpc_task *task)
1765 } 1765 }
1766 1766
1767 xprt = req->rq_xprt; 1767 xprt = req->rq_xprt;
1768 if (task->tk_ops->rpc_count_stats != NULL)
1769 task->tk_ops->rpc_count_stats(task, task->tk_calldata);
1770 else if (task->tk_client)
1771 rpc_count_iostats(task, task->tk_client->cl_metrics);
1772 xprt_request_dequeue_all(task, req); 1768 xprt_request_dequeue_all(task, req);
1773 spin_lock_bh(&xprt->transport_lock); 1769 spin_lock_bh(&xprt->transport_lock);
1774 xprt->ops->release_xprt(xprt, task); 1770 xprt->ops->release_xprt(xprt, task);