ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

memory-region

noelpedro opened this issue · comments

Hi Ichiro,

I currently have 1GB of DDR shared with the PL. And I'm currently bottle necked by the read speeds of using /dev/mem to read from this memory.

Can I expect an improvement in read speeds by using the u-dma-buf memory-region configuration? Its seems like by using CMA for the area I will definitely improve read speeds.

If reading from memory is slow, the reason may be that the data cache is disabled.

When reading from /dev/mem with mmap(), the data cache is disabled if the O_SYNC flag is specified when opening; opening without the O_SYNC flag enables the data cache.
Whether the data cache can be enabled or must be disabled depends on whether cache coherency is guaranteed by the hardware.
If cache coherency is guaranteed in hardware, then the data cache can be enabled. However, if cache coherency is not guaranteed by the hardware, the data cache must be disabled.

The above also applies to the use of u-dma-buf.

How about using udmabuf in python's memmap is there an O_SYNC flag enable/disable ? I'm mapping non-kernel memory so it will be uncached right? not much I can do on the PL side?

Please refer to the following repositories.

The dma-coherent flag for my udmabuf really sped up my memory reads. I also connected the ACP in the PL.