8.3.3.3. Enabling 1 GB huge pages for guests at boot or runtime


Red Hat Enterprise Linux 6.7 systems support 2 MB and 1 GB huge pages, which can be allocated at boot or at runtime.

Procedure 8.2. Allocating 1 GB huge pages at boot time

  1. To allocate different sizes of huge pages at boot, use the following command, specifying the number of huge pages. This example allocates 4 1 GB huge pages and 1024 2 MB huge pages:
    'default_hugepagesz=1G hugepagesz=1G hugepages=4 hugepagesz=2M hugepages=1024'
    
    Copy to Clipboard Toggle word wrap
    Change this command line to specify a different number of huge pages to be allocated at boot.

    Note

    The next two steps must also be completed the first time you allocate 1 GB huge pages at boot time.
  2. Mount the 2 MB and 1 GB huge pages on the host:
    # mkdir /dev/hugepages1G
    # mount -t hugetlbfs -o pagesize=1G none /dev/hugepages1G
    # mkdir /dev/hugepages2M
    # mount -t hugetlbfs -o pagesize=2M none /dev/hugepages2M
    
    Copy to Clipboard Toggle word wrap
  3. Restart libvirtd to enable the use of 1 GB huge pages on guests:
    # service restart libvirtd
    
    Copy to Clipboard Toggle word wrap
1 GB huge pages are now available for guests.

Procedure 8.3. Allocating 1 GB huge pages at runtime

1 GB huge pages can also be allocated at runtime. Runtime allocation allows the system administrator to choose which NUMA node to allocate those pages from. However, runtime page allocation can be more prone to allocation failure than boot time allocation due to memory fragmentation.
  1. To allocate different sizes of huge pages at runtime, use the following command, replacing values for the number of huge pages, the NUMA node to allocate them from, and the huge page size:
    # echo 4 > /sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages
    # echo 1024 > /sys/devices/system/node/node3/hugepages/hugepages-2048kB/nr_hugepages
    
    Copy to Clipboard Toggle word wrap
    This example command allocates 4 1 GB huge pages from node1 and 1024 2MB huge pages from node3.
    These huge page settings can be changed at any time with the above command, depending on the amount of free memory on the host system.

    Note

    The next two steps must also be completed the first time you allocate 1 GB huge pages at runtime.
  2. Mount the 2 MB and 1 GB huge pages on the host:
    # mkdir /dev/hugepages1G
    # mount -t hugetlbfs -o pagesize=1G none /dev/hugepages1G
    # mkdir /dev/hugepages2M
    # mount -t hugetlbfs -o pagesize=2M none /dev/hugepages2M
    
    Copy to Clipboard Toggle word wrap
  3. Restart libvirtd to enable the use of 1 GB huge pages on guests:
    # systemctl restart libvirtd
    
    Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat