Kernel Boot Parameters for HugeTLB Pages

The kernel boot options enable you to specify values such as the size and the number of pages to be reserved in the kernel's pool. Using the kernel boot parameters is the most reliable method of requesting huge pages.

The following table describes the kernel boot parameters available for HugeTLB page setup.

Table 2-1 The Kernel Boot Command Line Parameters for Requesting HugeTLB Pages

Parameters Purpose Accepted Value Option on x86_64 Architecture
default_hugepagesz Defines the default size of persistent huge pages configured in the kernel at boot time. 2M(default), 1G
hugepagesz and hugepages

Size parameter hugepagesz is used with quantity parameter hugepages to reserve a pool of a specified page size and quantity. For example, to request a pool of 1500 pages of size 2 MB, the command line options would be as follows:

hugepagesz=2M hugepages=1500

If multiple huge page sizes are supported, the "hugepagesz=<size> hugepages=<qty>" pair can be specified multiple times, once for each page size. For example, you can use the following command line options to request one pool of four pages of 1 GB size, and a second pool of 1500 pages of 2 MB size:

hugepagesz=1G hugepages=4 hugepagesz=2M hugepages=1500

Hugepagesz: 2M, 1G

hugepages: 0 or greater

Note:

In a NUMA system, pages reserved with kernel command line options, as shown in the previous table, are divided equally between the NUMA nodes.

If the requirement is to have a different number of pages on each node, you can use the file-based HugeTLB parameters in the sysfs file system. See File-Based Configuration Parameters for HugeTLB Pages and Requesting HugeTLB Pages Using NUMA Node Specific Parameters Early in the Boot Process.