[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240704163724.2462161-3-martin.oliveira@eideticom.com>
Date: Thu, 4 Jul 2024 10:37:23 -0600
From: Martin Oliveira <martin.oliveira@...eticom.com>
To: linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
linux-rdma@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Artemy Kovalyov <artemyko@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
Logan Gunthorpe <logang@...tatee.com>,
Martin Oliveira <martin.oliveira@...eticom.com>,
Michael Guralnik <michaelgur@...dia.com>,
Mike Marciniszyn <mike.marciniszyn@...el.com>,
Shiraz Saleem <shiraz.saleem@...el.com>,
Tejun Heo <tj@...nel.org>,
John Hubbard <jhubbard@...dia.com>,
Dan Williams <dan.j.williams@...el.com>,
David Sloan <david.sloan@...eticom.com>
Subject: [PATCH v3 2/3] mm/gup: allow FOLL_LONGTERM & FOLL_PCI_P2PDMA
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.
The one minor concern with FOLL_LONGTERM pins is they will block device
unbind until userspace releases them all.
Co-developed-by: Logan Gunthorpe <logang@...tatee.com>
Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
Signed-off-by: Martin Oliveira <martin.oliveira@...eticom.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 ca0f5cedce9b..6922e1c38d75 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;
-
*gup_flags_p = gup_flags;
return true;
}
--
2.34.1
Powered by blists - more mailing lists