From: John Hubbard <jhubbard@nvidia.com>
To: Martin Oliveira <martin.oliveira@eideticom.com>,
<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
Logan Gunthorpe <logang@deltatee.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>,
Michael Guralnik <michaelgur@nvidia.com>,
"Artemy Kovalyov" <artemyko@nvidia.com>
Subject: Re: [PATCH v2 3/4] mm/gup: allow FOLL_LONGTERM & FOLL_PCI_P2PDMA
Date: Fri, 14 Jun 2024 19:45:51 -0700 [thread overview]
Message-ID: <ac470f75-c276-4f15-b386-e88194e17f13@nvidia.com> (raw)
In-Reply-To: <20240611182732.360317-4-martin.oliveira@eideticom.com>
On 6/11/24 11:27 AM, Martin Oliveira wrote:
> This check existed originally due to concerns that P2PDMA needed to copy
> fsdax until pgmap refcounts were fixed (see [1]).
>
> The P2PDMA infrastructure will only call unmap_mapping_range() when the
> underlying device is unbound, and immediately after unmapping it waits
> for the reference of all ZONE_DEVICE pages to be released before
> continuing. This does not allow for a page to be reused and no user
> access fault is therefore possible. It does not have the same problem as
> fsdax.
This sounds great. I'm adding Dan Williams to Cc, in hopes of getting an
ack from him on this point.
>
> The one minor concern with FOLL_LONGTERM pins is they will block device
> unbind until userspace releases them all.
That seems like a completely reasonable consequence of what you are
doing here, IMHO.
>
> Co-developed-by: Logan Gunthorpe <logang@deltatee.com>
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
>
> [1]: https://lkml.kernel.org/r/Yy4Ot5MoOhsgYLTQ@ziepe.ca
> ---
> mm/gup.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 00d0a77112f4f..28060e41788d0 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -2614,11 +2614,6 @@ static bool is_valid_gup_args(struct page **pages, int *locked,
> if (WARN_ON_ONCE((gup_flags & (FOLL_GET | FOLL_PIN)) && !pages))
> return false;
>
> - /* We want to allow the pgmap to be hot-unplugged at all times */
> - if (WARN_ON_ONCE((gup_flags & FOLL_LONGTERM) &&
> - (gup_flags & FOLL_PCI_P2PDMA)))
> - return false;
> -
I am not immediately seeing anything wrong with this... :)
> *gup_flags_p = gup_flags;
> return true;
> }
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2024-06-15 2:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 18:27 [PATCH v2 0/4] Enable P2PDMA in Userspace RDMA Martin Oliveira
2024-06-11 18:27 ` [PATCH v2 1/4] kernfs: remove page_mkwrite() from vm_operations_struct Martin Oliveira
2024-06-12 8:09 ` Greg Kroah-Hartman
2024-06-12 17:29 ` Tejun Heo
2024-06-13 5:15 ` Dan Carpenter
2024-06-13 5:44 ` Christoph Hellwig
2024-06-15 2:32 ` John Hubbard
2024-06-11 18:27 ` [PATCH v2 2/4] mm/gup: handle ZONE_DEVICE pages in folio_fast_pin_allowed() Martin Oliveira
2024-06-15 2:40 ` John Hubbard
2024-06-26 22:23 ` Martin Oliveira
2024-06-11 18:27 ` [PATCH v2 3/4] mm/gup: allow FOLL_LONGTERM & FOLL_PCI_P2PDMA Martin Oliveira
2024-06-15 2:45 ` John Hubbard [this message]
2024-06-11 18:27 ` [PATCH v2 4/4] RDMA/umem: add support for P2P RDMA Martin Oliveira
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=ac470f75-c276-4f15-b386-e88194e17f13@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=artemyko@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--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 \
--cc=logang@deltatee.com \
--cc=martin.oliveira@eideticom.com \
--cc=michaelgur@nvidia.com \
--cc=mike.marciniszyn@intel.com \
--cc=shiraz.saleem@intel.com \
--cc=tj@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