I have a SBC module and it has Centos 7 with 3.10.0-1160.114.2.el7.x86_64 kernel version. I have to increase CMA size to 128MB which is default 4MB. I check my kernel menuconfig and DMA Contiguous Memory Allocation was enabled. I tried to way below:
- Define CMA parameters: You can define CMA parameters in the /boot/grub2/grub.cfg file or other configuration files used by Grub2. These parameters are typically added to the kernel command line. An example CMA parameter looks like this:
cma=256M
This sets the CMA size to 256 megabytes.
- Update Grub configuration: You can add the defined CMA parameter to the Grub configuration file using the following commands:
sudo vi /etc/default/grub
Add the CMA parameter to the GRUB_CMDLINE_LINUX line. For example:
GRUB_CMDLINE_LINUX="... cma=256M ..."
- Update Grub configuration: Save and exit the configuration, then update the Grub configuration using the following command:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot the system: Reboot the system for the changes to take effect:
sudo reboot
After did these I check my CmaTotal with cat /proc/meminfo
but it says CmaTotal 0kB and CmaFree 0kB.
How can I increase the CMA size in Centos 7?
Best regards.