LSB_HUGETLB

Syntax

LSB_HUGETLB=Y|N

Description

The information regarding which virtual memory page maps to which physical memory page is kept in a data structure named Page Table. Most architectures use a fast lookup cache named Translation Lookaside Buffer (TLB). Consequently, TLB misses bring additional performance costs, so it is important to reduce TLB misses.

In advanced architectures like x86 or IA64, huge page size is supported (for example, 2 Mb and 4 Mb sizes). The number of memory pages can be reduced through implementing the huge page size, which leads to decreased TLB misses and improved performance for processes like forked child, etc.

To configure huge page memory:
  1. Check the support and configuration of huge page size:

    cat /proc/meminfo | grep Huge

    The output of cat /proc/meminfo will include lines such as:
    HugePages_Total: vvv
    HugePages_Free: www
    HugePages_Rsvd: xxx
    HugePages_Surp: yyy
    Hugepagesize: zzz kB
    Where:
    • HugePages_Total is the size of the pool of huge pages.
    • HugePages_Free is the number of huge pages in the pool that are not yet allocated.
    • HugePages_Rsvd is short for "reserved" and is the number of huge pages for which a commitment to allocate from the pool has been made, though no allocation has yet been made. Reserved huge pages guarantee that an application can allocate a huge page from the pool of huge pages at fault time.
    • HugePages_Surp is short for "surplus" and is the number of huge pages in the pool above the value in /proc/sys/vm/nr_hugepages. The maximum number of surplus huge pages is controlled by /proc/sys/vm/nr_overcommit_hugepages.
  2. Configure the number of huge size pages:
    • To set the number of huge pages using /proc entry:

      # echo 5 > /proc/sys/vm/nr_hugepages

    • To set the number of huge pages using sysctl:

      # sysctl -w vm.nr_hugepages=5

    • To make the change permanent, add the following line to the file /etc/sysctl.conf:

      # echo "vm.nr_hugepages=5" >> /etc/sysctl.conf

      This file is used during the boot process.

You must reboot to allocate the number of hugepages needed. This is because hugepages requires large areas of contiguous physical memory. Over time, physical memory may be mapped and allocated to pages. Therefore, the physical memory can become fragmented.

Default

N