On 2022-06-29 00:48, Christoph Hellwig wrote: > On Wed, Jun 15, 2022 at 10:12:32AM -0600, Logan Gunthorpe wrote: >> A pseudo mount is used to allocate an inode for each PCI device. The >> inode's address_space is used in the file doing the mmap so that all >> VMAs are collected and can be unmapped if the PCI device is unbound. >> After unmapping, the VMAs are iterated through and their pages are >> put so the device can continue to be unbound. An active flag is used >> to signal to VMAs not to allocate any further P2P memory once the >> removal process starts. The flag is synchronized with concurrent >> access with an RCU lock. > > Can't we come up with a way of doing this without all the pseudo-fs > garbagage? I really hate all the overhead for that in the next > nvme patch as well. I assume you still want to be able to unmap the VMAs on unbind and not just hang? I'll see if I can come up with something to do the a similar thing using vm_private data or some such. I was not a fan of the extra code for this either, but I was given to understand that it was the standard way to collect and cleanup VMAs. Thanks for the reviews, Logan _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
- Re: [PATCH v7 11/21] RDMA/core: introduce ib_dma_pc... Christoph Hellwig
- [PATCH v7 21/21] nvme-pci: allow mmaping the CMB in user... Logan Gunthorpe
- [PATCH v7 07/21] dma-mapping: add flags to dma_map_ops t... Logan Gunthorpe
- Re: [PATCH v7 07/21] dma-mapping: add flags to dma_... Christoph Hellwig
- [PATCH v7 02/21] PCI/P2PDMA: Attempt to set map_type if ... Logan Gunthorpe
- Re: [PATCH v7 02/21] PCI/P2PDMA: Attempt to set map... Christoph Hellwig
- [PATCH v7 13/21] PCI/P2PDMA: Remove pci_p2pdma_[un]map_s... Logan Gunthorpe
- Re: [PATCH v7 13/21] PCI/P2PDMA: Remove pci_p2pdma_... Christoph Hellwig
- [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Logan Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap... Christoph Hellwig
- Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_... Logan Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce ... Jason Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDMA: Introd... Christoph Hellwig
- Re: [PATCH v7 20/21] PCI/P2PDMA: I... Jason Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDM... Christoph Hellwig
- Re: [PATCH v7 20/21] PCI/P2PDM... Jason Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDM... Christoph Hellwig
- Re: [PATCH v7 20/21] PCI/P2PDM... Logan Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDM... Christoph Hellwig
- Re: [PATCH v7 20/21] PCI/P2PDM... Logan Gunthorpe
- Re: [PATCH v7 20/21] PCI/P2PDM... Christoph Hellwig