On 2022-05-27 06:55, Jason Gunthorpe wrote:
> On Thu, Apr 07, 2022 at 09:47:16AM -0600, Logan Gunthorpe wrote:
>> +static void pci_p2pdma_unmap_mappings(void *data)
>> +{
>> + struct pci_dev *pdev = data;
>> + struct pci_p2pdma *p2pdma = rcu_dereference_protected(pdev->p2pdma, 1);
>> +
>> + /* Ensure no new pages can be allocated in mappings */
>> + p2pdma->active = false;
>> + synchronize_rcu();
>> +
>> + unmap_mapping_range(p2pdma->inode->i_mapping, 0, 0, 1);
>> +
>> + /*
>> + * On some architectures, TLB flushes are done with call_rcu()
>> + * so to ensure GUP fast is done with the pages, call synchronize_rcu()
>> + * before freeing them.
>> + */
>> + synchronize_rcu();
>> + pci_p2pdma_free_mappings(p2pdma->inode->i_mapping);
>
> With the series from Felix getting close this should get updated to
> not set pte_devmap and use proper natural refcounting without any of
> this stuff.
Can you send a link? I'm not sure what you are referring to.
Thanks,
Logan
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
- [PATCH v6 09/21] nvme-pci: check DMA ops when indicating s... Logan Gunthorpe
- [PATCH v6 10/21] nvme-pci: convert to using dma_map_sgtabl... Logan Gunthorpe
- [PATCH v6 05/21] dma-mapping: allow EREMOTEIO return code ... Logan Gunthorpe
- [PATCH v6 06/21] dma-direct: support PCI P2PDMA pages in d... Logan Gunthorpe
- [PATCH v6 17/21] lib/scatterlist: add check when merging z... Logan Gunthorpe
- [PATCH v6 03/21] PCI/P2PDMA: Expose pci_p2pdma_map_type() Logan Gunthorpe
- [PATCH v6 18/21] block: set FOLL_PCI_P2PDMA in __bio_iov_i... Logan Gunthorpe
- [PATCH v6 15/21] iov_iter: introduce iov_iter_get_pages_[a... Logan Gunthorpe
- [PATCH v6 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA: Introduce pci_mmap_p... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA: Introduce pci_mm... Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA: Introduce pc... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA: Introduc... Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA: Int... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Logan Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Jason Gunthorpe
- Re: [PATCH v6 20/21] PCI/P2PDMA:... Logan Gunthorpe
