On 2021-09-28 1:47 p.m., Jason Gunthorpe wrote: > On Thu, Sep 16, 2021 at 05:40:54PM -0600, Logan Gunthorpe wrote: >> 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. Probably not terrible to go this way. Logan _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
- Re: [PATCH v3 03/20] PCI/P2PDMA: make pci_p... Bjorn Helgaas
- Re: [PATCH v3 03/20] PCI/P2PDMA: make pci_p... Jason Gunthorpe
- [PATCH v3 13/20] PCI/P2PDMA: remove pci_p2pdma_[... Logan Gunthorpe
- Re: [PATCH v3 13/20] PCI/P2PDMA: remove pci... Bjorn Helgaas
- Re: [PATCH v3 13/20] PCI/P2PDMA: remove pci... Jason Gunthorpe
- [PATCH v3 15/20] iov_iter: introduce iov_iter_ge... Logan Gunthorpe
- [PATCH v3 02/20] PCI/P2PDMA: attempt to set map_... Logan Gunthorpe
- Re: [PATCH v3 02/20] PCI/P2PDMA: attempt to... Bjorn Helgaas
- [PATCH v3 14/20] mm: introduce FOLL_PCI_P2PDMA t... Logan Gunthorpe
- Re: [PATCH v3 14/20] mm: introduce FOLL_PCI... Jason Gunthorpe
- Re: [PATCH v3 14/20] mm: introduce FOLL... Logan Gunthorpe
- Re: [PATCH v3 14/20] mm: introduce ... Jason Gunthorpe
- [PATCH v3 04/20] PCI/P2PDMA: introduce helpers f... Logan Gunthorpe
- Re: [PATCH v3 04/20] PCI/P2PDMA: introduce ... Bjorn Helgaas
- Re: [PATCH v3 04/20] PCI/P2PDMA: introd... Logan Gunthorpe
- Re: [PATCH v3 04/20] PCI/P2PDMA: introduce ... Jason Gunthorpe
- Re: [PATCH v3 04/20] PCI/P2PDMA: introd... Logan Gunthorpe
- Re: [PATCH v3 4/20] PCI/P2PDMA: introduce h... Jason Gunthorpe via iommu
- Re: [PATCH v3 4/20] PCI/P2PDMA: introdu... Logan Gunthorpe
- Re: [PATCH v3 4/20] PCI/P2PDMA: int... Jason Gunthorpe via iommu
- Re: [PATCH v3 4/20] PCI/P2PDMA:... Logan Gunthorpe