AnsweredAssumed Answered

Galcore module and cache-coherency

Question asked by Todd Blanchard on Mar 27, 2020
Latest reply on Apr 3, 2020 by Bio_TICFSL

Please advise on the following regarding CMA and galcore cache-flushing. This is on an iMX6q, kernel version 4.9.88.

 

The galcore module allocates a large CMA region defined by contiguousSize at module load. This region is MEM/BUFFERABLE/WC (uncached) in the kernel. The same region is then mmapped via _CMAFSLMapUser() and the subsequent (virtual) address space is then 'flushed' via gckOS_CacheFlush(). This cache flush takes upwards of 800 ms, and is done for each process which mmaps the same area (5 in our case).

 

This is adding significant time to application start. Here are the questions/comments:

 

  • I see no configuration to completely disable the cache flushing because the command buffers are allocated via the gfp allocator, and are cacheable. Setting CACHE_FUNCTION_UNIMPLEMENTED will cause the command buffer operations to fail in obscure ways.
  • The flushing of the mmapped area seems unnecessary, as the region is memset/flushed by the kernel during dma_alloc_wc() and the region is uncached.

 

Is there a configuration other than a specific code change that allows the mmapped CMA to bypass the cache flushing but keep the cache-flushing for the command buffers allocated from the gfp area? In addition, why would the CMA allocator perform cache-flushing (CMA is not cacheable).

 

Thanks,
Todd

Outcomes