linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-rdma <linux-rdma@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v1 1/6] xprtrdma: Add unique trace points for posting Local Invalidate WRs
Date: Wed, 9 Oct 2019 13:10:13 -0400	[thread overview]
Message-ID: <68B39F44-0AB3-489F-A9A2-EDF7976339A6@oracle.com> (raw)
In-Reply-To: <20191009170721.2978.128.stgit@manet.1015granger.net>

Hi-

> On Oct 9, 2019, at 1:07 PM, Chuck Lever <chuck.lever@oracle.com> wrote:
> 
> When adding frwr_unmap_async way back when, I re-used the existing
> trace_xprtrdma_post_send() trace point to record the return code
> of ib_post_send.
> 
> Unfortunately there are some cases where re-using that trace point
> causes a crash. Instead, construct a trace point specific to posting
> Local Invalidate WRs that will always be safe to use in that context,
> and will act as a trace log eye-catcher for Local Invalidation.

I forgot to add a cover letter to this series.

The first patch fixes a crasher that shows up when the rpcrdma trace
class is enabled.

The remaining patches address issues with how the RPC/RDMA client
handles MRs. See individual patch descriptions for details.


> Fixes: 847568942f93 ("xprtrdma: Remove fr_state")
> Fixes: d8099feda483 ("xprtrdma: Reduce context switching due ... ")
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> Tested-by: Bill Baker <bill.baker@oracle.com>
> ---
> include/trace/events/rpcrdma.h |   25 +++++++++++++++++++++++++
> net/sunrpc/xprtrdma/frwr_ops.c |    4 ++--
> 2 files changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/rpcrdma.h b/include/trace/events/rpcrdma.h
> index 9dd7680..31681cb 100644
> --- a/include/trace/events/rpcrdma.h
> +++ b/include/trace/events/rpcrdma.h
> @@ -735,6 +735,31 @@
> 	)
> );
> 
> +TRACE_EVENT(xprtrdma_post_linv,
> +	TP_PROTO(
> +		const struct rpcrdma_req *req,
> +		int status
> +	),
> +
> +	TP_ARGS(req, status),
> +
> +	TP_STRUCT__entry(
> +		__field(const void *, req)
> +		__field(int, status)
> +		__field(u32, xid)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->req = req;
> +		__entry->status = status;
> +		__entry->xid = be32_to_cpu(req->rl_slot.rq_xid);
> +	),
> +
> +	TP_printk("req=%p xid=0x%08x status=%d",
> +		__entry->req, __entry->xid, __entry->status
> +	)
> +);
> +
> /**
>  ** Completion events
>  **/
> diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
> index 30065a2..9901a81 100644
> --- a/net/sunrpc/xprtrdma/frwr_ops.c
> +++ b/net/sunrpc/xprtrdma/frwr_ops.c
> @@ -570,7 +570,6 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
> 	 */
> 	bad_wr = NULL;
> 	rc = ib_post_send(r_xprt->rx_ia.ri_id->qp, first, &bad_wr);
> -	trace_xprtrdma_post_send(req, rc);
> 
> 	/* The final LOCAL_INV WR in the chain is supposed to
> 	 * do the wake. If it was never posted, the wake will
> @@ -583,6 +582,7 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
> 
> 	/* Recycle MRs in the LOCAL_INV chain that did not get posted.
> 	 */
> +	trace_xprtrdma_post_linv(req, rc);
> 	while (bad_wr) {
> 		frwr = container_of(bad_wr, struct rpcrdma_frwr,
> 				    fr_invwr);
> @@ -673,12 +673,12 @@ void frwr_unmap_async(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
> 	 */
> 	bad_wr = NULL;
> 	rc = ib_post_send(r_xprt->rx_ia.ri_id->qp, first, &bad_wr);
> -	trace_xprtrdma_post_send(req, rc);
> 	if (!rc)
> 		return;
> 
> 	/* Recycle MRs in the LOCAL_INV chain that did not get posted.
> 	 */
> +	trace_xprtrdma_post_linv(req, rc);
> 	while (bad_wr) {
> 		frwr = container_of(bad_wr, struct rpcrdma_frwr, fr_invwr);
> 		mr = container_of(frwr, struct rpcrdma_mr, frwr);
> 

--
Chuck Lever




      parent reply	other threads:[~2019-10-09 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 17:07 [PATCH v1 1/6] xprtrdma: Add unique trace points for posting Local Invalidate WRs Chuck Lever
2019-10-09 17:07 ` [PATCH v1 2/6] xprtrdma: Connection becomes unstable after a reconnect Chuck Lever
2019-10-09 17:07 ` [PATCH v1 3/6] xprtrdma: Initialize rb_credits in one place Chuck Lever
2019-10-09 17:07 ` [PATCH v1 4/6] xprtrdma: Close window between waking RPC senders and posting Receives Chuck Lever
2019-10-09 17:07 ` [PATCH v1 5/6] xprtrdma: Fix MR list handling Chuck Lever
2019-10-09 17:07 ` [PATCH v1 6/6] xprtrdma: Manage MRs in context of a single connection Chuck Lever
2019-10-09 17:10 ` Chuck Lever [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=68B39F44-0AB3-489F-A9A2-EDF7976339A6@oracle.com \
    --to=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 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).