Re: [PATCH v2 2/2] dma: add IOMMU static calls with clear default ops
From: Leon Romanovsky
Date: Mon Jul 29 2024 - 10:07:50 EST
On Mon, Jul 29, 2024 at 12:41:12PM +0000, Mostafa Saleh wrote:
> Hi Leon,
>
> On Wed, Jul 17, 2024 at 03:37:11PM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxx>
> >
> > Most of the arch DMA ops (which often, but not always, involve
> > some sort of IOMMU) are using the same DMA operations. These DMA
> > operations are default ones implemented in drivers/iomem/dma-iommu.c.
> >
> > So let's make sure to call them directly without need to perform function
> > pointers dereference.
>
> Just out of curiosity, is there any observed improvement from that?
> As from my experience the DMA-IOMMU path is quite dense so it won't
> be senstive to such micro-optimizations.
DMA-IOMMU no, but NVMe driver which uses DMA-API in datapath will
potentially benefit from this change.
I personally used this change to simplify my "DMA split ... " series [1].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=dma-split-v2
Thanks