From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Chuck Lever <chuck.lever@oracle.com>,
linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org,
Sagi Grimberg <sagig@mellanox.com>
Subject: Re: [PATCH v1 3/9] xprtrdma: Introduce ro_unmap_sync method
Date: Tue, 24 Nov 2015 00:28:21 -0700 [thread overview]
Message-ID: <20151124072821.GD23597@obsidianresearch.com> (raw)
In-Reply-To: <20151124064556.GA29141@infradead.org>
On Mon, Nov 23, 2015 at 10:45:56PM -0800, Christoph Hellwig wrote:
> On Mon, Nov 23, 2015 at 05:14:14PM -0500, Chuck Lever wrote:
> > In the current xprtrdma implementation, some memreg strategies
> > implement ro_unmap synchronously (the MR is knocked down before the
> > method returns) and some asynchonously (the MR will be knocked down
> > and returned to the pool in the background).
> >
> > To guarantee the MR is truly invalid before the RPC consumer is
> > allowed to resume execution, we need an unmap method that is
> > always synchronous, invoked from the RPC/RDMA reply handler.
> >
> > The new method unmaps all MRs for an RPC. The existing ro_unmap
> > method unmaps only one MR at a time.
>
> Do we really want to go down that road? It seems like we've decided
> in general that while the protocol specs say MR must be unmapped before
> proceeding with the data that is painful enough to ignore this
That is not my impression, I was thinking we keep finding that ULPs
are not implemented correctly. The various clean up exercises keep
exposing flaws.
The common code is intended to drive RDMA properly.
Async invalidating the rkey is fundamentally a security issue and
should be treated as such. The kernel never trades security for
performance without a user opt in. This is the same logic we've used
for purging the global writable rkey stuff, even though it often had
performance.
> requirement. E.g. iser for example only does the local invalidate
> just before reusing the MR.
Ugh :(
> I'd like to hear arguments for and against each method instead of
> adding more magic to drivers to either optimize MR performance and
> add clunky workarounds to make it even slower, and instead handled
> the semantics we agreed upo in common code.
Common code should make it easy to do this right, an invalidate of the
MR ordered before the dma unmap, which must complete before the buffer
is handed back to the caller. With easy support for send with
invalidate.
If the common code has an opt-in to make some of these steps run
async, and that gives performance, then fine, but the default should be
secure operation.
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v1 3/9] xprtrdma: Introduce ro_unmap_sync method
Date: Tue, 24 Nov 2015 00:28:21 -0700 [thread overview]
Message-ID: <20151124072821.GD23597@obsidianresearch.com> (raw)
In-Reply-To: <20151124064556.GA29141-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
On Mon, Nov 23, 2015 at 10:45:56PM -0800, Christoph Hellwig wrote:
> On Mon, Nov 23, 2015 at 05:14:14PM -0500, Chuck Lever wrote:
> > In the current xprtrdma implementation, some memreg strategies
> > implement ro_unmap synchronously (the MR is knocked down before the
> > method returns) and some asynchonously (the MR will be knocked down
> > and returned to the pool in the background).
> >
> > To guarantee the MR is truly invalid before the RPC consumer is
> > allowed to resume execution, we need an unmap method that is
> > always synchronous, invoked from the RPC/RDMA reply handler.
> >
> > The new method unmaps all MRs for an RPC. The existing ro_unmap
> > method unmaps only one MR at a time.
>
> Do we really want to go down that road? It seems like we've decided
> in general that while the protocol specs say MR must be unmapped before
> proceeding with the data that is painful enough to ignore this
That is not my impression, I was thinking we keep finding that ULPs
are not implemented correctly. The various clean up exercises keep
exposing flaws.
The common code is intended to drive RDMA properly.
Async invalidating the rkey is fundamentally a security issue and
should be treated as such. The kernel never trades security for
performance without a user opt in. This is the same logic we've used
for purging the global writable rkey stuff, even though it often had
performance.
> requirement. E.g. iser for example only does the local invalidate
> just before reusing the MR.
Ugh :(
> I'd like to hear arguments for and against each method instead of
> adding more magic to drivers to either optimize MR performance and
> add clunky workarounds to make it even slower, and instead handled
> the semantics we agreed upo in common code.
Common code should make it easy to do this right, an invalidate of the
MR ordered before the dma unmap, which must complete before the buffer
is handed back to the caller. With easy support for send with
invalidate.
If the common code has an opt-in to make some of these steps run
async, and that gives performance, then fine, but the default should be
secure operation.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-11-24 7:28 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 22:13 [PATCH v1 0/9] NFS/RDMA client patches for 4.5 Chuck Lever
2015-11-23 22:13 ` Chuck Lever
2015-11-23 22:13 ` [PATCH v1 1/9] xprtrdma: Add a safety margin for receive buffers Chuck Lever
2015-11-23 22:13 ` Chuck Lever
2015-11-24 0:55 ` Tom Talpey
2015-11-24 0:55 ` Tom Talpey
2015-11-24 1:16 ` Chuck Lever
2015-11-24 1:16 ` Chuck Lever
2015-11-24 1:22 ` Tom Talpey
2015-11-24 1:22 ` Tom Talpey
2015-11-24 1:44 ` Chuck Lever
2015-11-24 1:44 ` Chuck Lever
2015-11-23 22:14 ` [PATCH v1 2/9] xprtrdma: Move struct ib_send_wr off the stack Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-23 22:14 ` [PATCH v1 3/9] xprtrdma: Introduce ro_unmap_sync method Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-24 6:45 ` Christoph Hellwig
2015-11-24 6:45 ` Christoph Hellwig
2015-11-24 7:28 ` Jason Gunthorpe [this message]
2015-11-24 7:28 ` Jason Gunthorpe
2015-11-24 10:59 ` Sagi Grimberg
2015-11-24 10:59 ` Sagi Grimberg
2015-11-24 13:43 ` Tom Talpey
2015-11-24 13:43 ` Tom Talpey
2015-11-24 14:40 ` Sagi Grimberg
2015-11-24 14:40 ` Sagi Grimberg
2015-11-24 14:39 ` Chuck Lever
2015-11-24 14:39 ` Chuck Lever
2015-11-24 14:44 ` Sagi Grimberg
2015-11-24 14:44 ` Sagi Grimberg
2015-11-24 15:20 ` Chuck Lever
2015-11-24 15:20 ` Chuck Lever
2015-11-24 18:57 ` Jason Gunthorpe
2015-11-24 18:57 ` Jason Gunthorpe
2015-11-23 22:14 ` [PATCH v1 4/9] xprtrdma: Add ro_unmap_sync method for FRWR Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-23 22:14 ` [PATCH v1 5/9] xprtrdma: Add ro_unmap_sync method for FMR Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-24 0:57 ` Tom Talpey
2015-11-24 0:57 ` Tom Talpey
2015-11-24 6:52 ` Future of FMR support, was: " Christoph Hellwig
2015-11-24 6:52 ` Christoph Hellwig
2015-11-24 7:12 ` Jason Gunthorpe
2015-11-24 7:12 ` Jason Gunthorpe
2015-12-01 15:33 ` Chuck Lever
2015-12-01 15:33 ` Chuck Lever
2015-12-02 12:27 ` Christoph Hellwig
2015-12-02 12:27 ` Christoph Hellwig
2015-11-24 12:36 ` Tom Talpey
2015-11-24 12:36 ` Tom Talpey
2015-11-24 21:54 ` santosh shilimkar
2015-11-24 21:54 ` santosh shilimkar
2015-11-25 9:00 ` Christoph Hellwig
2015-11-25 9:00 ` Christoph Hellwig
2015-11-25 17:09 ` santosh shilimkar
2015-11-25 17:09 ` santosh shilimkar
2015-11-25 18:22 ` Or Gerlitz
2015-11-25 18:22 ` Or Gerlitz
2015-11-25 19:17 ` santosh shilimkar
2015-11-25 19:17 ` santosh shilimkar
2015-11-25 19:28 ` Jason Gunthorpe
2015-11-25 19:28 ` Jason Gunthorpe
2015-11-26 10:01 ` Sagi Grimberg
2015-11-26 10:01 ` Sagi Grimberg
2015-11-23 22:14 ` [PATCH v1 6/9] xprtrdma: Add ro_unmap_sync method for all-physical registration Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-23 22:14 ` [PATCH v1 7/9] SUNRPC: Introduct xprt_commit_rqst() Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-24 19:54 ` Anna Schumaker
2015-11-24 19:54 ` Anna Schumaker
2015-11-24 19:56 ` Chuck Lever
2015-11-24 19:56 ` Chuck Lever
2015-11-23 22:14 ` [PATCH v1 8/9] xprtrdma: Invalidate in the RPC reply handler Chuck Lever
2015-11-23 22:14 ` Chuck Lever
2015-11-24 1:01 ` Tom Talpey
2015-11-24 1:01 ` Tom Talpey
2015-11-23 22:15 ` [PATCH v1 9/9] xprtrdma: Revert commit e7104a2a9606 ('xprtrdma: Cap req_cqinit') Chuck Lever
2015-11-23 22:15 ` 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=20151124072821.GD23597@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=chuck.lever@oracle.com \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sagig@mellanox.com \
/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.