Re: [PATCH 2/2] staging: vc04_services: Replace dmac_map_area with dmac_map_sg

From: Michael Zoran
Date: Mon Oct 24 2016 - 10:56:15 EST


On Mon, 2016-10-24 at 15:24 +0200, Greg KH wrote:
> On Sun, Oct 23, 2016 at 10:29:32PM -0700, mzoran@xxxxxxxxxxxx wrote:
> > From: Michael Zoran <mzoran@xxxxxxxxxxxx>
> >
> > The original arm implementation uses dmac_map_area which is not
> > portable.ÂÂReplace it with an architecture neutral version
> > which uses dma_map_sg.
> >
> > As you can see that for larger page sizes, the dma_map_sg
> > implementation is faster then the original unportable dma_map_area
> > implementation.ÂÂ
> >
> > TestÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdmac_map_areaÂÂÂdma_map_page dma_map_sg
> > vchiq_test -b 4 10000ÂÂÂÂÂÂ51us/iterÂÂÂÂÂÂÂ76us/iterÂÂÂÂ76us
> > vchiq_test -b 8 10000ÂÂÂÂÂÂ70us/iterÂÂÂÂÂÂÂ82us/iterÂÂÂÂ91us
> > vchiq_test -b 16 10000ÂÂÂÂÂ94us/iterÂÂÂÂÂÂÂ118us/iterÂÂÂ121us
> > vchiq_test -b 32 10000ÂÂÂÂÂ146us/iterÂÂÂÂÂÂ173us/iterÂÂÂ187us
> > vchiq_test -b 64 10000ÂÂÂÂÂ263us/iterÂÂÂÂÂÂ328us/iterÂÂÂ299us
> > vchiq_test -b 128 10000ÂÂÂÂ529us/iterÂÂÂÂÂÂ631us/iterÂÂÂ595us
> > vchiq_test -b 256 10000ÂÂÂÂ2285us/iterÂÂÂÂÂ2275us/iterÂÂ2001us
> > vchiq_test -b 512 10000ÂÂÂÂ4372us/iterÂÂÂÂÂ4616us/iterÂÂ4123us
> >
> > For message sizes >= 64KB, dma_map_sg is faster then dma_map_page.
> >
> > For message size >= 256KB, the dma_map_sg is the fastest
> > implementation.
>
> What is the "normal" message size value when using this driver?
>
> thanks,
>
> greg k-h

I honestly have no idea. From what I understand, the only code that
actually uses this code path is the closed source multimedia drivers
which I know nothing about.

Obviously, one approach would be to have the kernel collect data on
what the typical size is after running some benchmarks.