Enabling Huge Pages

Getting Started with Napatech Link-Virtualization™ Software

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

Enabling huge pages 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 memory for huge pages.
    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 huge pages 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 huge pages on Linux hosts, refer to the Linux hugetlbfs guide.

    For more information on DPDK huge pages, 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 huge pages and IOMMU, as in this example:
GRUB_CMDLINE_LINUX="default_hugepagesz=1G hugepagesz=1G hugepages=32 intel_iommu=on"