DMA, CMA, coherence and performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm working on a device driver for a video device which continuously reads and writes image frames using DMA. The frames are fairly large, in the range of 2-8MB, and I would like the buffers for them to be contiguous because of my hardware. My understanding is that using the contiguous memory allocator is the current "right way" to get the buffers, and that CMA operates entirely behind the scenes when calls are made to dma_alloc_coherent().

However, it seems that for this system, a streaming DMA setup would be more appropriate.  The buffer gets filled with data once, handed to the device, and then isn't touched again until it gets reused with new data.  The resources I've read have hinted that streaming DMA has some performance benefits over coherent DMA, so this seems like the way to go.  But I haven't seen any discussion of how to use CMA with streaming DMA (or whether such a thing is even necessary).

Does the CMA also work behind get_free_pages, or other kernel memory allocation methods?  Does it matter?  The kernel newbies page on memory allocation (http://kernelnewbies.org/KernelMemoryAllocation) says that get_free_pages up to about 8MB are ok.  Is that a generalization based on typical memory fragmentation, or a guarantee?

Thanks,
Steven
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux