Enabling Huge Page Memory

Getting Started with Napatech Link-Virtualization™ Software

Platform
Napatech SmartNIC
Content Type
Getting Started Guide
Capture Software Version
Link-Virtualization™ Software 4.4

Enabling huge page memory provides important performance improvements for DPDK workloads by requiring fewer translations between virtual and physical addresses.

About this task

While hugepages may be allocated at boot time or run time, boot time allocation is less susceptible allocation failure due to memory fragmentation.

Procedure

  1. Enable hugepages memory.
    Edit the file /etc/default/grub and add the following parameters to the existing GRUB_CMDLINE_LINUX line:
    default_hugepagesz=1G hugepagesz=1G hugepages=32
    Note: Change the hugepages parameter to specify a different number of huge pages to be allocated at boot. We recommend that you set hugepages to 16 or more consistent with your needs and the constraints of your system.
  2. Create a mount point and mount hugetlbfs.
    mkdir /mnt/huge
    mount -t hugetlbfs none /mnt/huge
  3. Mount hugepages automatically at boot time to avoid the need to remount after a system restart.
    Edit the file /etc/fstab and add the following entry:
    nodev /mnt/huge hugetlbfs defaults 0 0

    For further information about configuring hugepages on Linux hosts, refer to the Linux hugetlbfs guide.

    For more information on DPDK Hugepages, refer to the documentation at: https://dpdk-guide.gitlab.io/dpdk-guide/setup/hugepages.html

Results

The final Grub configuration file will include a GRUB_CMDLINE_LINUX line, specifying parameters for hugepages and IOMMU, as in this example:
GRUB_CMDLINE_LINUX="default_hugepagesz=1G hugepagesz=1G hugepages=32 intel_iommu=on"