From: Jason Gunthorpe <jgg@nvidia.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: <linux-nfs@vger.kernel.org>, <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH v1] svcrdma: Hold private mutex while invoking rdma_accept()
Date: Fri, 12 Feb 2021 10:43:55 -0400 [thread overview]
Message-ID: <20210212144355.GA1696322@nvidia.com> (raw)
In-Reply-To: <161308170145.1097.4777972218876421176.stgit@klimt.1015granger.net>
On Thu, Feb 11, 2021 at 05:15:30PM -0500, Chuck Lever wrote:
> RDMA core mutex locking was restructured by d114c6feedfe ("RDMA/cma:
> Add missing locking to rdma_accept()") [Aug 2020]. When lock
> debugging is enabled, the RPC/RDMA server trips over the new lockdep
> assertion in rdma_accept() because it doesn't call rdma_accept()
> from its CM event handler.
>
> As a temporary fix, have svc_rdma_accept() take the mutex
> explicitly. In the meantime, let's consider how to restructure the
> RPC/RDMA transport to invoke rdma_accept() from the proper context.
>
> Calls to svc_rdma_accept() are serialized with calls to
> svc_rdma_free() by the generic RPC server layer.
>
> Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Fixes line
> ---
> net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 ++
> 1 file changed, 2 insertions(+)
It could even be right like this..
This should be inside the lock though:
newxprt->sc_cm_id->event_handler = svc_rdma_cma_handler;
But this really funny looking, before it gets to accept the handler is
still the listen handler so any incoming events will just be
discarded.
However the rdma_accept() should fail if the state machine has been
moved from the accepting state, and I think the only meaningful event
that can be delivered here is disconnect. So the rdma_accept() failure
does trigger destroy_id, which is the right thing on disconnect anyhow.
Jason
next prev parent reply other threads:[~2021-02-12 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 22:15 [PATCH v1] svcrdma: Hold private mutex while invoking rdma_accept() Chuck Lever
2021-02-12 14:43 ` Jason Gunthorpe [this message]
2021-02-12 14:50 ` Chuck Lever
2021-02-12 14:55 ` Jason Gunthorpe
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=20210212144355.GA1696322@nvidia.com \
--to=jgg@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox