From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] svcrdma: Preserve CB send buffer across retransmits
Date: Mon, 23 Oct 2017 16:41:34 -0400 [thread overview]
Message-ID: <20171023204134.GB21106@fieldses.org> (raw)
In-Reply-To: <20171016161133.29152.48259.stgit@klimt.1015granger.net>
Thanks for the ping, apologies for the delay.
On Mon, Oct 16, 2017 at 12:14:33PM -0400, Chuck Lever wrote:
> During each NFSv4 callback Call, an RDMA Send completion frees the
> page that contains the RPC Call message. If the upper layer
> determines that a retransmit is necessary, this is too soon.
>
> One possible symptom: after a GARBAGE_ARGS response an NFSv4.1
> callback request, the following BUG fires on the NFS server:
...
> It would be great if this could go into v4.14-rc, but I can live
> with v4.15.
OK, I'll be slightly lazy and queue this up for 4.15....
> Jeff's review suggested adding a comment documenting the requirement
> that rqst->rq_buffer is backed by a single page. However, all of the
> server-side transport mechanics are page-based, so I'm not sure this
> wouldn't be a redundant comment. Suggestions welcome.
If it's always a page then I guess the way to make it ridiculously
obvious would be to keep a pointer to the page instead and use
page_address() as necessary, but.... I'm guessing that's inconvenient
for other users.
So, no suggestions.
--b.
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
> index ec37ad8..1854db2 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
> @@ -132,6 +132,10 @@ static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma,
> if (ret)
> goto out_err;
>
> + /* Bump page refcnt so Send completion doesn't release
> + * the rq_buffer before all retransmits are complete.
> + */
> + get_page(virt_to_page(rqst->rq_buffer));
> ret = svc_rdma_post_send_wr(rdma, ctxt, 1, 0);
> if (ret)
> goto out_unmap;
> @@ -164,7 +168,6 @@ static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma,
> return -EINVAL;
> }
>
> - /* svc_rdma_sendto releases this page */
> page = alloc_page(RPCRDMA_DEF_GFP);
> if (!page)
> return -ENOMEM;
> @@ -183,6 +186,7 @@ static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma,
> {
> struct rpc_rqst *rqst = task->tk_rqstp;
>
> + put_page(virt_to_page(rqst->rq_buffer));
> kfree(rqst->rq_rbuffer);
> }
>
prev parent reply other threads:[~2017-10-23 20:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 16:14 [PATCH] svcrdma: Preserve CB send buffer across retransmits Chuck Lever
2017-10-23 18:12 ` Chuck Lever
2017-10-23 20:41 ` J. Bruce Fields [this message]
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=20171023204134.GB21106@fieldses.org \
--to=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@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 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).