From: Anna Schumaker <Anna.Schumaker@Netapp.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: <linux-rdma@vger.kernel.org>, <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2] SUNRPC: Initialize rpc_rqst outside of xprt->reserve_lock
Date: Tue, 3 Apr 2018 16:12:12 -0400 [thread overview]
Message-ID: <fa0afd37-bd06-cfe6-4c5f-e471ede3703f@Netapp.com> (raw)
In-Reply-To: <20180311152620.16974.96109.stgit@manet.1015granger.net>
Hi Chuck,
On 03/11/2018 11:27 AM, Chuck Lever wrote:
> alloc_slot is a transport-specific op, but initializing an rpc_rqst
> is common to all transports. In addition, the only part of initial-
> izing an rpc_rqst that needs serialization is getting a fresh XID.
>
> Move rpc_rqst initialization to common code in preparation for
> adding a transport-specific alloc_slot to xprtrdma.
I'm having trouble with this patch again. This time I'm running xfstests generic/074 with NFS v4.0, and my client starts seeing "nfs: server 192.168.100.215 not responding, still trying" after about a minute. Any thoughts about what's going on here? I keep trying to capture it with Wireshark, but there are enough packets on the wire to crash Wireshark.
Thoughts?
Anna
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> include/linux/sunrpc/xprt.h | 1 +
> net/sunrpc/clnt.c | 1 +
> net/sunrpc/xprt.c | 12 +++++++-----
> 3 files changed, 9 insertions(+), 5 deletions(-)
>
> Changes since v1:
> - Partial sends should not bump the XID
>
> diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
> index 5fea0fb..9784e28 100644
> --- a/include/linux/sunrpc/xprt.h
> +++ b/include/linux/sunrpc/xprt.h
> @@ -324,6 +324,7 @@ struct xprt_class {
> struct rpc_xprt *xprt_create_transport(struct xprt_create *args);
> void xprt_connect(struct rpc_task *task);
> void xprt_reserve(struct rpc_task *task);
> +void xprt_request_init(struct rpc_task *task);
> void xprt_retry_reserve(struct rpc_task *task);
> int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
> int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index 6e432ec..226f558 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -1546,6 +1546,7 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
> task->tk_status = 0;
> if (status >= 0) {
> if (task->tk_rqstp) {
> + xprt_request_init(task);
> task->tk_action = call_refresh;
> return;
> }
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 70f0050..2d95926 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -66,7 +66,7 @@
> * Local functions
> */
> static void xprt_init(struct rpc_xprt *xprt, struct net *net);
> -static void xprt_request_init(struct rpc_task *, struct rpc_xprt *);
> +static __be32 xprt_alloc_xid(struct rpc_xprt *xprt);
> static void xprt_connect_status(struct rpc_task *task);
> static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *);
> static void __xprt_put_cong(struct rpc_xprt *, struct rpc_rqst *);
> @@ -987,6 +987,8 @@ bool xprt_prepare_transmit(struct rpc_task *task)
> task->tk_status = -EAGAIN;
> goto out_unlock;
> }
> + if (!bc_prealloc(req) && !req->rq_xmit_bytes_sent)
> + req->rq_xid = xprt_alloc_xid(xprt);
> ret = true;
> out_unlock:
> spin_unlock_bh(&xprt->transport_lock);
> @@ -1163,10 +1165,10 @@ void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)
> out_init_req:
> xprt->stat.max_slots = max_t(unsigned int, xprt->stat.max_slots,
> xprt->num_reqs);
> + spin_unlock(&xprt->reserve_lock);
> +
> task->tk_status = 0;
> task->tk_rqstp = req;
> - xprt_request_init(task, xprt);
> - spin_unlock(&xprt->reserve_lock);
> }
> EXPORT_SYMBOL_GPL(xprt_alloc_slot);
>
> @@ -1303,8 +1305,9 @@ static inline void xprt_init_xid(struct rpc_xprt *xprt)
> xprt->xid = prandom_u32();
> }
>
> -static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
> +void xprt_request_init(struct rpc_task *task)
> {
> + struct rpc_xprt *xprt = task->tk_xprt;
> struct rpc_rqst *req = task->tk_rqstp;
>
> INIT_LIST_HEAD(&req->rq_list);
> @@ -1312,7 +1315,6 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
> req->rq_task = task;
> req->rq_xprt = xprt;
> req->rq_buffer = NULL;
> - req->rq_xid = xprt_alloc_xid(xprt);
> req->rq_connect_cookie = xprt->connect_cookie - 1;
> req->rq_bytes_sent = 0;
> req->rq_snd_buf.len = 0;
>
next prev parent reply other threads:[~2018-04-03 20:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-11 15:27 [PATCH v2] SUNRPC: Initialize rpc_rqst outside of xprt->reserve_lock Chuck Lever
2018-03-12 0:41 ` Tom Talpey
2018-03-12 10:56 ` Jeff Layton
2018-03-12 13:07 ` Trond Myklebust
2018-03-12 14:30 ` Chuck Lever
2018-04-03 20:12 ` Anna Schumaker [this message]
2018-04-03 20:38 ` Chuck Lever
2018-04-03 20:48 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa0afd37-bd06-cfe6-4c5f-e471ede3703f@Netapp.com \
--to=anna.schumaker@netapp.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.