CMA: can configure iMX6UL CMA size less than 32M ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CMA: can configure iMX6UL CMA size less than 32M ?

605 Views
yunyangsihai
Contributor II

Dears:

We only have 128M memory on our iMX6UL product, apps need more available memory, Can we configure the CMA lower than 32M?

iMX6UL + BSP4.1.15

yunyangsihai_0-1637580382459.png

I have search the cma related code, found that iMX6 configure the FORCE_MAX_ZONEORDER as 14 default, as a result, 32M is the minimal CMA value on iMX6 and is the maximal mem pageblock value (page size is 4K). We can not disable CMA directly, because iMX6 uses CMA as a backend of DMA buffers allocation for most of the cases.

But as introduced in "How to get rid of CMA".

(https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-get-rid-of-CMA/ta-p/1123287)

  • The biggest consumer of DMA is GPU, it's usage can be monitored by gmem_info tool. Monitor the gmem_info under the typical use cases, and settle down the GPU required memory.
  • Checking for 2nd consumer of DMA: ISI/Camera, depends on the V4l2 reqbuf size and numbers
  • Checking VPU, depends on the multimedia frameworks
  • Plus alsa snd, USB, fec usage

We do not have those GPU, CSI Camera, VPU multimedia (video), audio alsa (audio)and USB device related functions on our product. Those functions are the biggest consumers on the platform.

But we need LCD display, Ethernet, CAN, UART, I2C and so on.

Questions:

(1). Can we configure the CMA lower than 32M, and configure FORCE_MAX_ZONEORDER lower than 14 ? Will it slow down the performance of whole system or memory system.

(2). Whether it is enough or not if we configure CMA as 16M or 8M ? How can we count the DMA requirement of LCD, Ethernet, CAN, UART and so on; maybe a test method ?

Many Thanks.

Labels (1)
Tags (1)
0 Kudos
1 Reply

590 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yang 

 

>(1). Can we configure the CMA lower than 32M, and configure FORCE_MAX_ZONEORDER lower

>than 14 ? Will it slow down the performance of whole system or memory system.

 

seems this is possible. In general this may affect performance.

 

>(2). Whether it is enough or not if we configure CMA as 16M or 8M ? How can we count the

>DMA requirement of LCD, Ethernet, CAN, UART and so on; maybe a test method ?

 

rough estimation can be found in slide 7 presentation Aarch64 Kernel Memory Management.pptx
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/aarch64-Linux-Kernel-Memory-Management/t...

 

Best regards
igor

0 Kudos