Thread (87 messages) 87 messages, 8 authors, 2021-10-05

Re: [PATCH v3 14/20] mm: introduce FOLL_PCI_P2PDMA to gate getting PCI P2PDMA pages

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2021-09-29 22:48:38
Also in: linux-iommu, linux-mm, linux-nvme, linux-pci, lkml

On Wed, Sep 29, 2021 at 03:34:22PM -0600, Logan Gunthorpe wrote:


On 2021-09-28 1:47 p.m., Jason Gunthorpe wrote:
quoted
On Thu, Sep 16, 2021 at 05:40:54PM -0600, Logan Gunthorpe wrote:
quoted
Callers that expect PCI P2PDMA pages can now set FOLL_PCI_P2PDMA to
allow obtaining P2PDMA pages. If a caller does not set this flag
and tries to map P2PDMA pages it will fail.

This is implemented by adding a flag and a check to get_dev_pagemap().
I would like to see the get_dev_pagemap() deleted from GUP in the
first place.

Why isn't this just a simple check of the page->pgmap type after
acquiring a valid page reference? See my prior note
It could be, but that will mean dereferencing the pgmap for every page
to determine the type of page and then comparing with FOLL_PCI_P2PDMA.
It would be done under the pte devmap test and this is less expensive
than the xarray search.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help