A. Enabling Hugepages
This section covers information about how to enable 2 MB hugepages temporarily and persistently. Intel® recommends you to begin by temporarily enabling huge pages and later if you want to avoid revisiting the steps to enable hugepages persistently.
Temporarily Enabling 2 MB Hugepages
If you have already boot your system into the operating system, you can enable twenty 2 MB hugepages by running the following command:
sudo sh -c "echo 20 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"
You can also enable two 1 MB hugepages and twenty 2 MB hugepages at boot time by passing the following boot time arguments to GRUB:
default_hugepagesz=2MB hugepagesz=2M hugepages=20
Persistently Enabling 2 MB Hugepages
This section explains how to enable twenty 2 MB hugepages persistently so that the setting remains persistent across reboots and power cycles.
- In Ubuntu: Perform the following steps to enable twenty 2 MB hugepages on a Ubuntu system:
- Edit /etc/default/grub and add the following text to the end of the file:
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} default_hugepagesz=2MB hugepagesz=2M hugepages=20"
- Save the GRUB file.
- Update GRUB by committing the updated settings:
sudo update-grub
- Reboot the system.
- Edit /etc/default/grub and add the following text to the end of the file:
- In RHEL: Perform the following steps to enable twenty 2 MB hugepages on a RHEL system:
- Edit /etc/default/grub and add the following text to the end of the file:
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} default_hugepagesz=2MB hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=20"
- Save the GRUB file.
- Update GRUB by committing the updated settings:
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
- Reboot the system.
- Edit /etc/default/grub and add the following text to the end of the file: