Centos 7 Increase CMA Size

General support questions
Post Reply
alperen
Posts: 2
Joined: 2024/05/02 10:03:27

Centos 7 Increase CMA Size

Post by alperen » 2024/05/02 10:06:14

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:
1. 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:

Code: Select all

cma=256M
This sets the CMA size to 256 megabytes.
2. Update Grub configuration: You can add the defined CMA parameter to the Grub configuration file using the following commands:

Code: Select all

sudo vi /etc/default/grub
Add the CMA parameter to the GRUB_CMDLINE_LINUX line. For example:

Code: Select all

GRUB_CMDLINE_LINUX="... cma=256M ..."
3. Update Grub configuration: Save and exit the configuration, then update the Grub configuration using the following command:

Code: Select all

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
4. Reboot the system: Reboot the system for the changes to take effect:

Code: Select all

sudo reboot
After did these I check my CmaTotal with

Code: Select all

cat /proc/meminfo
but it says CmaTotal 0kB and CmaFree 0kB.

How can I increase the CMA size in Centos 7?

Best regards.

User avatar
TrevorH
Site Admin
Posts: 33241
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 7 Increase CMA Size

Post by TrevorH » 2024/05/02 15:42:45

Check in /proc/cmdline to see if your changes took effect.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

alperen
Posts: 2
Joined: 2024/05/02 10:03:27

Re: Centos 7 Increase CMA Size

Post by alperen » 2024/05/03 05:02:26

Hi,

Thank you for your reply. You can find outputs in the link below:

Code: Select all

https://codefile.io/f/3oLhhDzXB8
I did exactly these but it didn't effect my CmaTotal.

Best regards.

Post Reply