linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Christoph Hellwig <hch@infradead.org>,
	Ira Weiny <ira.weiny@intel.com>, <linux-rdma@vger.kernel.org>,
	<linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 1/2] mm/gup: allow FOLL_FORCE for get_user_pages_fast()
Date: Mon, 9 Dec 2019 11:54:36 -0800	[thread overview]
Message-ID: <7ceb9a54-6e2f-6d1f-70ba-f6ad5ba0b37f@nvidia.com> (raw)
In-Reply-To: <20191209182536.GC67461@unreal>

On 12/9/19 10:25 AM, Leon Romanovsky wrote:
> On Wed, Dec 04, 2019 at 01:36:02PM -0800, John Hubbard wrote:
>> Commit 817be129e6f2 ("mm: validate get_user_pages_fast flags") allowed
>> only FOLL_WRITE and FOLL_LONGTERM to be passed to get_user_pages_fast().
>> This, combined with the fact that get_user_pages_fast() falls back to
>> "slow gup", which *does* accept FOLL_FORCE, leads to an odd situation:
>> if you need FOLL_FORCE, you cannot call get_user_pages_fast().
>>
>> There does not appear to be any reason for filtering out FOLL_FORCE.
>> There is nothing in the _fast() implementation that requires that we
>> avoid writing to the pages. So it appears to have been an oversight.
>>
>> Fix by allowing FOLL_FORCE to be set for get_user_pages_fast().
>>
>> Fixes: 817be129e6f2 ("mm: validate get_user_pages_fast flags")
>> Cc: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>> ---
>>  mm/gup.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
> 
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> 

Hi Leon, thanks for the reviews, great timing! I'll add the tags to
the commits, which I'm just about to post as part of the larger 
"pin user pages" patchset.


thanks,
-- 
John Hubbard
NVIDIA


  reply	other threads:[~2019-12-09 19:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 21:36 [PATCH v2 0/2] IB/umem: use get_user_pages_fast() to pin DMA pages John Hubbard
2019-12-04 21:36 ` [PATCH v2 1/2] mm/gup: allow FOLL_FORCE for get_user_pages_fast() John Hubbard
2019-12-09 18:25   ` Leon Romanovsky
2019-12-09 19:54     ` John Hubbard [this message]
2019-12-04 21:36 ` [PATCH v2 2/2] IB/umem: use get_user_pages_fast() to pin DMA pages John Hubbard
2019-12-09 18:25   ` Leon Romanovsky

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=7ceb9a54-6e2f-6d1f-70ba-f6ad5ba0b37f@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=ira.weiny@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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).