linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Final NFS/RDMA series for v4.16
@ 2018-01-03 20:38 Chuck Lever
  2018-01-03 20:38 ` [PATCH 1/6] xprtrdma: Fix "bytes registered" accounting Chuck Lever
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

Hi Anna-

Here are some minor fixes and clean ups to finish out the set of
patches for v4.16. Included are fixes for a few issues I noticed
in sunrpc.ko.

---

Chuck Lever (6):
      xprtrdma: Fix "bytes registered" accounting
      xprtrdma: Correct some documenting comments
      SUNRPC: Trace xprt_timer events
      sunrpc: Format RPC events consistently for display
      SUNRPC: task_run_action should display tk_callback
      SUNRPC: Micro-optimize __rpc_execute


 include/trace/events/sunrpc.h     |    8 ++++++--
 net/sunrpc/sched.c                |   26 ++++++++++++--------------
 net/sunrpc/xprt.c                 |    2 +-
 net/sunrpc/xprtrdma/backchannel.c |    2 +-
 net/sunrpc/xprtrdma/rpc_rdma.c    |    4 ++--
 net/sunrpc/xprtrdma/transport.c   |    2 --
 net/sunrpc/xprtrdma/verbs.c       |    2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)

--
Chuck Lever

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] xprtrdma: Fix "bytes registered" accounting
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  2018-01-03 20:38 ` [PATCH 2/6] xprtrdma: Correct some documenting comments Chuck Lever
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

The contents of seg->mr_len changed when ->ro_map stopped returning
the full chunk length in the first segment. Count the full length of
each Write chunk, not the length of the first segment (which now can
only be as large as a page).

Fixes: 9d6b04097882 ("xprtrdma: Place registered MWs on a ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/rpc_rdma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index 1ae9b41..162e5dd 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -431,7 +431,7 @@ static bool rpcrdma_results_inline(struct rpcrdma_xprt *r_xprt,
 
 		trace_xprtrdma_write_chunk(rqst->rq_task, mr, nsegs);
 		r_xprt->rx_stats.write_chunk_count++;
-		r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+		r_xprt->rx_stats.total_rdma_request += mr->mr_length;
 		nchunks++;
 		nsegs -= mr->mr_nents;
 	} while (nsegs);
@@ -489,7 +489,7 @@ static bool rpcrdma_results_inline(struct rpcrdma_xprt *r_xprt,
 
 		trace_xprtrdma_reply_chunk(rqst->rq_task, mr, nsegs);
 		r_xprt->rx_stats.reply_chunk_count++;
-		r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+		r_xprt->rx_stats.total_rdma_request += mr->mr_length;
 		nchunks++;
 		nsegs -= mr->mr_nents;
 	} while (nsegs);


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/6] xprtrdma: Correct some documenting comments
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
  2018-01-03 20:38 ` [PATCH 1/6] xprtrdma: Fix "bytes registered" accounting Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  2018-01-03 20:38 ` [PATCH 3/6] SUNRPC: Trace xprt_timer events Chuck Lever
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

Fix kernel-doc warnings in net/sunrpc/xprtrdma/ .

net/sunrpc/xprtrdma/verbs.c:1575: warning: No description found for parameter 'count'
net/sunrpc/xprtrdma/verbs.c:1575: warning: Excess function parameter 'min_reqs' description in 'rpcrdma_ep_post_extra_recv'

net/sunrpc/xprtrdma/backchannel.c:288: warning: No description found for parameter 'r_xprt'
net/sunrpc/xprtrdma/backchannel.c:288: warning: Excess function parameter 'xprt' description in 'rpcrdma_bc_receive_call'

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/backchannel.c |    2 +-
 net/sunrpc/xprtrdma/verbs.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
index ca0c5d3..ed1a4a3 100644
--- a/net/sunrpc/xprtrdma/backchannel.c
+++ b/net/sunrpc/xprtrdma/backchannel.c
@@ -294,7 +294,7 @@ void xprt_rdma_bc_free_rqst(struct rpc_rqst *rqst)
 
 /**
  * rpcrdma_bc_receive_call - Handle a backward direction call
- * @xprt: transport receiving the call
+ * @r_xprt: transport receiving the call
  * @rep: receive buffer containing the call
  *
  * Operational assumptions:
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 57e1139..f4eb63e 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1584,7 +1584,7 @@ struct rpcrdma_regbuf *
 /**
  * rpcrdma_ep_post_extra_recv - Post buffers for incoming backchannel requests
  * @r_xprt: transport associated with these backchannel resources
- * @min_reqs: minimum number of incoming requests expected
+ * @count: minimum number of incoming requests expected
  *
  * Returns zero if all requested buffers were posted, or a negative errno.
  */


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/6] SUNRPC: Trace xprt_timer events
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
  2018-01-03 20:38 ` [PATCH 1/6] xprtrdma: Fix "bytes registered" accounting Chuck Lever
  2018-01-03 20:38 ` [PATCH 2/6] xprtrdma: Correct some documenting comments Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  2018-01-03 20:38 ` [PATCH 4/6] sunrpc: Format RPC events consistently for display Chuck Lever
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

Track RPC timeouts: report the XID and the server address to match
the content of network capture.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 include/trace/events/sunrpc.h   |    4 ++++
 net/sunrpc/xprt.c               |    2 +-
 net/sunrpc/xprtrdma/transport.c |    2 --
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 8c153f6..7804d85 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -390,6 +390,10 @@
 			__entry->status)
 );
 
+DEFINE_EVENT(rpc_xprt_event, xprt_timer,
+	TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
+	TP_ARGS(xprt, xid, status));
+
 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
 	TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
 	TP_ARGS(xprt, xid, status));
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 33b74fd..2436fd1 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -940,8 +940,8 @@ static void xprt_timer(struct rpc_task *task)
 
 	if (task->tk_status != -ETIMEDOUT)
 		return;
-	dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
 
+	trace_xprt_timer(xprt, req->rq_xid, task->tk_status);
 	if (!req->rq_reply_bytes_recvd) {
 		if (xprt->ops->timer)
 			xprt->ops->timer(xprt, task);
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index b90179a..4b1ecfe 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -516,8 +516,6 @@
 static void
 xprt_rdma_timer(struct rpc_xprt *xprt, struct rpc_task *task)
 {
-	dprintk("RPC: %5u %s: xprt = %p\n", task->tk_pid, __func__, xprt);
-
 	xprt_force_disconnect(xprt);
 }
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/6] sunrpc: Format RPC events consistently for display
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
                   ` (2 preceding siblings ...)
  2018-01-03 20:38 ` [PATCH 3/6] SUNRPC: Trace xprt_timer events Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  2018-01-03 20:38 ` [PATCH 5/6] SUNRPC: task_run_action should display tk_callback Chuck Lever
  2018-01-03 20:38 ` [PATCH 6/6] SUNRPC: Micro-optimize __rpc_execute Chuck Lever
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

Clean up: Make it easier to use text search when browsing a trace
report. Other events use "status=%d".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 include/trace/events/sunrpc.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 7804d85..0594e66 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -32,7 +32,7 @@
 		__entry->status = task->tk_status;
 	),
 
-	TP_printk("task:%u@%u, status %d",
+	TP_printk("task:%u@%u status=%d",
 		__entry->task_id, __entry->client_id,
 		__entry->status)
 );
@@ -66,7 +66,7 @@
 		__entry->status = status;
 	),
 
-	TP_printk("task:%u@%u, status %d",
+	TP_printk("task:%u@%u status=%d",
 		__entry->task_id, __entry->client_id,
 		__entry->status)
 );


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/6] SUNRPC: task_run_action should display tk_callback
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
                   ` (3 preceding siblings ...)
  2018-01-03 20:38 ` [PATCH 4/6] sunrpc: Format RPC events consistently for display Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  2018-01-03 20:38 ` [PATCH 6/6] SUNRPC: Micro-optimize __rpc_execute Chuck Lever
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

This shows up in every RPC:

     kworker/4:1-19772 [004]  3467.373443: rpc_task_run_action:  task:4711@2 flags=0e81 state=0005 status=0 action=call_status
     kworker/4:1-19772 [004]  3467.373444: rpc_task_run_action:  task:4711@2 flags=0e81 state=0005 status=0 action=call_status

What's actually going on is that the first iteration of the RPC
scheduler is invoking the function in tk_callback (in this case,
xprt_timer), then invoking call_status on the next iteration.

Feeding do_action, rather than tk_action, to the "task_run_action"
trace point will now always display the correct FSM step.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/sched.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index b1b49ed..c292a5e 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -770,7 +770,7 @@ static void __rpc_execute(struct rpc_task *task)
 			if (do_action == NULL)
 				break;
 		}
-		trace_rpc_task_run_action(task->tk_client, task, task->tk_action);
+		trace_rpc_task_run_action(task->tk_client, task, do_action);
 		do_action(task);
 
 		/*


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/6] SUNRPC: Micro-optimize __rpc_execute
  2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
                   ` (4 preceding siblings ...)
  2018-01-03 20:38 ` [PATCH 5/6] SUNRPC: task_run_action should display tk_callback Chuck Lever
@ 2018-01-03 20:38 ` Chuck Lever
  5 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2018-01-03 20:38 UTC (permalink / raw)
  To: anna.schumaker; +Cc: linux-rdma, linux-nfs

The common case: There are 13 to 14 actions per RPC, and tk_callback
is non-NULL in only one of them. There's no need to store a NULL in
the tk_callback field during each FSM step.

This slightly improves throughput results in dbench and other multi-
threaded benchmarks on my two-socket client on 56Gb InfiniBand, but
will probably be inconsequential on slower systems.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/sched.c |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index c292a5e..896691a 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -755,21 +755,19 @@ static void __rpc_execute(struct rpc_task *task)
 		void (*do_action)(struct rpc_task *);
 
 		/*
-		 * Execute any pending callback first.
+		 * Perform the next FSM step or a pending callback.
+		 *
+		 * tk_action may be NULL if the task has been killed.
+		 * In particular, note that rpc_killall_tasks may
+		 * do this at any time, so beware when dereferencing.
 		 */
-		do_action = task->tk_callback;
-		task->tk_callback = NULL;
-		if (do_action == NULL) {
-			/*
-			 * Perform the next FSM step.
-			 * tk_action may be NULL if the task has been killed.
-			 * In particular, note that rpc_killall_tasks may
-			 * do this at any time, so beware when dereferencing.
-			 */
-			do_action = task->tk_action;
-			if (do_action == NULL)
-				break;
+		do_action = task->tk_action;
+		if (task->tk_callback) {
+			do_action = task->tk_callback;
+			task->tk_callback = NULL;
 		}
+		if (!do_action)
+			break;
 		trace_rpc_task_run_action(task->tk_client, task, do_action);
 		do_action(task);
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-03 20:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-03 20:38 [PATCH 0/6] Final NFS/RDMA series for v4.16 Chuck Lever
2018-01-03 20:38 ` [PATCH 1/6] xprtrdma: Fix "bytes registered" accounting Chuck Lever
2018-01-03 20:38 ` [PATCH 2/6] xprtrdma: Correct some documenting comments Chuck Lever
2018-01-03 20:38 ` [PATCH 3/6] SUNRPC: Trace xprt_timer events Chuck Lever
2018-01-03 20:38 ` [PATCH 4/6] sunrpc: Format RPC events consistently for display Chuck Lever
2018-01-03 20:38 ` [PATCH 5/6] SUNRPC: task_run_action should display tk_callback Chuck Lever
2018-01-03 20:38 ` [PATCH 6/6] SUNRPC: Micro-optimize __rpc_execute Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).