netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Subject: Re: [net-next][PATCH v2 1/2] rds: handle unsupported rdma request to fs dax memory
Date: Fri, 10 May 2019 15:07:19 -0300	[thread overview]
Message-ID: <20190510180719.GD13038@ziepe.ca> (raw)
In-Reply-To: <9b0e6760-b684-c1ce-6bf5-738eff325240@oracle.com>

On Fri, May 10, 2019 at 11:02:35AM -0700, santosh.shilimkar@oracle.com wrote:
> 
> 
> On 5/10/19 10:55 AM, Jason Gunthorpe wrote:
> > On Fri, May 10, 2019 at 09:11:24AM -0700, Santosh Shilimkar wrote:
> > > On 5/10/2019 5:54 AM, Jason Gunthorpe wrote:
> > > > On Mon, Apr 29, 2019 at 04:37:19PM -0700, Santosh Shilimkar wrote:
> > > > > From: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
> > > > > 
> > > > > RDS doesn't support RDMA on memory apertures that require On Demand
> > > > > Paging (ODP), such as FS DAX memory. User applications can try to use
> > > > > RDS to perform RDMA over such memories and since it doesn't report any
> > > > > failure, it can lead to unexpected issues like memory corruption when
> > > > > a couple of out of sync file system operations like ftruncate etc. are
> > > > > performed.
> > > > 
> > > > This comment doesn't make any sense..
> > > > 
> > > > > The patch adds a check so that such an attempt to RDMA to/from memory
> > > > > apertures requiring ODP will fail.
> > > > > 
> > > > > Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
> > > > > Reviewed-tested-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> > > > > Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
> > > > > Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> > > > >    net/rds/rdma.c | 5 +++--
> > > > >    1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/net/rds/rdma.c b/net/rds/rdma.c
> > > > > index 182ab84..e0a6b72 100644
> > > > > +++ b/net/rds/rdma.c
> > > > > @@ -158,8 +158,9 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
> > > > >    {
> > > > >    	int ret;
> > > > > -	ret = get_user_pages_fast(user_addr, nr_pages, write, pages);
> > > > > -
> > > > > +	/* get_user_pages return -EOPNOTSUPP for fs_dax memory */
> > > > > +	ret = get_user_pages_longterm(user_addr, nr_pages,
> > > > > +				      write, pages, NULL);
> > > > 
> > > > GUP is supposed to fully work on DAX filesystems.
> > > > 
> > > Above comment has typo. Should have been
> > > get_user_pages_longterm return -EOPNOTSUPP.
> > > 
> > > > You only need to switch to the long term version if the duration of
> > > > the GUP is under control of user space - ie it may last forever.
> > > > 
> > > > Short duration pins in the kernel do not need long term.
> > > > 
> > > Thats true but the intention here is to use the long term version
> > > which does check for the FS DAX memory. Instead of calling direct
> > > accessor to check DAX memory region, longterm version of the API
> > > is used
> > > 
> > > > At a minimum the commit message needs re-writing to properly explain
> > > > the motivation here.
> > > > 
> > > Commit is actually trying to describe the motivation describing more of
> > > issues of not making the call fail. The code comment typo was
> > > misleading.
> > 
> > Every single sentence in the commit message is wrong
> > 
> I will rewrite commit message but can you please comment on other
> questions above. GUP long term was used to detect whether its
> fs_dax memory which could be misleading since the RDS MRs are
> short lived. Do you want us to use accessor instead to check
> if its FS DAX memory?

Why would you need to detect FS DAX memory? GUP users are not supposed
to care.

GUP is supposed to work just 'fine' - other than the usual bugs we
have with GUP and any FS backed memory.

Jason

  reply	other threads:[~2019-05-10 18:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 23:37 [net-next][PATCH v2 0/2] rds: handle unsupported rdma request to fs dax memory Santosh Shilimkar
2019-04-29 23:37 ` [net-next][PATCH v2 1/2] " Santosh Shilimkar
2019-05-01  7:44   ` Leon Romanovsky
2019-05-01 17:54     ` Santosh Shilimkar
2019-05-02  6:21       ` Leon Romanovsky
2019-05-02 17:52         ` Santosh Shilimkar
2019-05-05  6:28           ` Leon Romanovsky
2019-05-06 16:39             ` Santosh Shilimkar
2019-05-10 12:54   ` Jason Gunthorpe
2019-05-10 16:11     ` Santosh Shilimkar
2019-05-10 17:55       ` Jason Gunthorpe
2019-05-10 18:02         ` santosh.shilimkar
2019-05-10 18:07           ` Jason Gunthorpe [this message]
2019-05-10 18:58             ` santosh.shilimkar
2019-05-10 19:20               ` Jason Gunthorpe
2019-05-10 19:38                 ` Santosh Shilimkar
2019-05-10 19:47                   ` Jason Gunthorpe
2019-05-10 20:12                     ` Santosh Shilimkar
2019-05-10 20:39                       ` Jason Gunthorpe
2019-04-29 23:37 ` [net-next][PATCH v2 2/2] rds: add sysctl for rds support of On-Demand-Paging Santosh Shilimkar
2019-05-01  7:45   ` Leon Romanovsky
2019-05-01 17:54     ` Santosh Shilimkar
2019-05-02  6:18       ` Leon Romanovsky
2019-05-02 17:59         ` Santosh Shilimkar
2019-05-05  6:22           ` Leon Romanovsky
2019-05-06 16:37             ` Santosh Shilimkar
2019-05-10 13:02   ` Jason Gunthorpe
2019-05-10 16:13     ` Santosh Shilimkar

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=20190510180719.GD13038@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=davem@davemloft.net \
    --cc=hans.westgaard.ry@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=santosh.shilimkar@oracle.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 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).