All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] SUNRPC: Prevent thundering herd when the socket is not connected
@ 2019-03-05 15:17 Trond Myklebust
  2019-03-05 15:17 ` [PATCH v2 2/3] SUNRPC: Fix up RPC back channel transmission Trond Myklebust
  0 siblings, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2019-03-05 15:17 UTC (permalink / raw)
  To: linux-nfs

If the socket is not connected, then we want to initiate a reconnect
rather that trying to transmit requests. If there is a large number
of requests queued and waiting for the lock in call_transmit(),
then it can take a while for one of the to loop back and retake
the lock in call_connect.

Fixes: 89f90fe1ad8b ("SUNRPC: Allow calls to xprt_transmit() to drain...")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 net/sunrpc/clnt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 241e8423fd0c..e7ae75a045c9 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2003,6 +2003,12 @@ call_transmit(struct rpc_task *task)
 	if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) {
 		if (!xprt_prepare_transmit(task))
 			return;
+		/* Check that the connection is OK */
+		if (!xprt_connected(task->tk_xprt) ||
+		    !xprt_bound(task->tk_xprt)) {
+			task->tk_action = call_bind;
+			return;
+		}
 		xprt_transmit(task);
 	}
 	task->tk_action = call_transmit_status;
-- 
2.20.1


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

end of thread, other threads:[~2019-03-05 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-05 15:17 [PATCH v2 1/3] SUNRPC: Prevent thundering herd when the socket is not connected Trond Myklebust
2019-03-05 15:17 ` [PATCH v2 2/3] SUNRPC: Fix up RPC back channel transmission Trond Myklebust
2019-03-05 15:17   ` [PATCH v2 3/3] SUNRPC: Micro-optimisation to avoid call_bind+call_commit Trond Myklebust
2019-03-05 16:07     ` Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.