Slow access to data in mmaped memory areas
David Müller (ELSOFT AG)
d.mueller at elsoft.ch
Sat Mar 5 08:23:04 PST 2016
I have a multi-core Cortex-A9 based system where an external busmaster
capable device is transmitting data into the system memory.
Unfortunately the device's DMA engine does not support "scatter-gather"
The CPU job is to process the data received from the device.
I have written a driver which allocates serveral continuous memory block
(each 2MiB in size) as buffers, and transfers the data from the external
device to the buffers by DMA.
I have also written an application which accesses the data by "mmaping"
the buffers into the application's address space.
All this works ok, but processing performance of the data by the CPU is
After looking at arch/arm/mm/mmu.c and arch/arm/mm/dma-mapping.c, it
seems like caching is disabled for all mmaped memory areas.
Is this observation correct?
Is there a way to re-enable caching for mmaped memory areas after the
DMA transfer is completed and to disable caching before the next DMA starts?
More information about the linux-arm-kernel