RPC/RDMA patchset addendum
Subsystems (3)
cover RPC/RDMA patchset addendum
Trond, the following two patches implement the reestablish_timeout backoff for rpc/rdma connection attempts. per your comment. This way is certainly cleaner! The new patch has two functional components so it is split.
These should go in with the prior set, as they fix existing issues in the 2.6.25->2.6.27 codeline.
---
Tom Talpey (2):
RPC/RDMA: ensure connection attempt is complete before signalling. RPC/RDMA: correct the reconnect timer backoff
net/sunrpc/xprtrdma/transport.c | 7 +++++++ net/sunrpc/xprtrdma/verbs.c | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
Tom.
A message that is not in the archive (sent off-list or not yet received): 20081010152634.3983.91559.stgit-pfX4bTJKMULWwzOYslWYilaTQe2KTcn/@public.gmane.org
PATCH 1/2 RPC/RDMA: correct the reconnect timer backoff
The RPC/RDMA code had a constant 5-second reconnect backoff, and always performed it, even when re-establishing a connection to a server after the RPC layer closed it due to being idle. Make it an geometric backoff (up to 30 seconds), and don't delay idle reconnect.
---
net/sunrpc/xprtrdma/transport.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
net/sunrpc/xprtrdma/transport.c +7 -0
@@ -463,6 +463,8 @@ xprt_rdma_close(struct rpc_xprt *xprt)struct rpcrdma_xprt *r_xprt =rpcx_to_rdmax (xprt);dprintk ("RPC: %s: closing\n" , __func__); +if (r_xprt->rx_ep.rep_connected >0 ) + xprt->reestablish_timeout =0 ;xprt_disconnect_done (xprt); (void )rpcrdma_ep_disconnect (&r_xprt->rx_ep, &r_xprt->rx_ia); }
@@ -490,6 +492,11 @@ xprt_rdma_connect(struct rpc_task *task)/* Reconnect */ schedule_delayed_work (&r_xprt->rdma_connect, xprt->reestablish_timeout); + xprt->reestablish_timeout <<=1 ; +if (xprt->reestablish_timeout > (30 *HZ )) + xprt->reestablish_timeout = (30 *HZ ); +else if (xprt->reestablish_timeout < (5 *HZ )) + xprt->reestablish_timeout = (5 *HZ ); }else {schedule_delayed_work (&r_xprt->rdma_connect,0 );if (!RPC_IS_ASYNC (task))
PATCH 2/2 RPC/RDMA: ensure connection attempt is complete before signalling.
In reply to a message not in the archiveThe RPC/RDMA connection logic could return early from reconnection attempts, leading to additional spurious retries.
---
net/sunrpc/xprtrdma/verbs.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
net/sunrpc/xprtrdma/verbs.c +1 -5
@@ -804,9 +804,8 @@ rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)struct rdma_cm_id *id;int rc =0 ;int retry_count =0 ; -int reconnect = (ep->rep_connected !=0 ); -if (reconnect) { +if (ep->rep_connected !=0 ) {struct rpcrdma_xprt *xprt; retry: rc =rpcrdma_ep_disconnect (ep, ia);
@@ -871,9 +870,6 @@ if (strnicmp(ia->ri_id->device->dma_device->bus->name, "pci", 3) == 0) { goto out; } -if (reconnect) -return 0 ; -wait_event_interruptible (ep->rep_connect_wait, ep->rep_connected !=0 );/*