Re: [PATCH 6/7] dma-iommu: implement ->alloc_noncontiguous

From: Sergey Senozhatsky
Date: Mon Mar 01 2021 - 02:18:40 EST


On (21/02/16 09:49), Christoph Hellwig wrote:
> > When working on the videobuf2 integration with Sergey I noticed that
> > we always pass 0 as DMA attrs here, which removes the ability for
> > drivers to use DMA_ATTR_ALLOC_SINGLE_PAGES.
> >
> > It's quite important from a system stability point of view, because by
> > default the iommu_dma allocator would prefer big order allocations for
> > TLB locality reasons. For many devices, though, it doesn't really
> > affect the performance, because of random access patterns, so single
> > pages are good enough and reduce the risk of allocation failures or
> > latency due to fragmentation.
> >
> > Do you think we could add the attrs parameter to the
> > dma_alloc_noncontiguous() API?
>
> Yes, we could probably do that.

I can cook a patch, unless somebody is already looking into it.

-ss