[PATCHv3 0/7] dma mapping optimisations
Christoph Hellwig
hch at lst.de
Tue Aug 9 11:41:37 PDT 2022
On Tue, Aug 09, 2022 at 10:46:04AM -0600, Keith Busch wrote:
> I am a bit reluctant to require a new memory allocator to use the feature. I'm
> also generally not concerned about the odd resource constrained IOMMU. User
> space drivers pre-map all their memory resources up front, and this is
> essentially the same concept.
Yes, it really isn't an issue for the modern iommus that support vfio,
but it is a limitation on the dma-api. The old iommus aren't really the
issue, but..
> For swiotlb, though, we can error out the mapping if the requested memory uses
> swiotlb with the device: the driver's .dma_map() can return ENOTSUPP if
> is_swiotlb_buffer() is true. Would that be more acceptable?
No, is_swiotlb_buffer and similar are not exported APIs. More importantly
with the various secure hypervisor schemes swiotlb is unfortunately
actually massively increasing these days. On those systems all streaming
mappings use swiotlb. And the only way to get any kind of half-decent
I/O performance would be the "special" premapped allocator, which is
another reason why I'd like to see it.
More information about the Linux-nvme
mailing list