What is the use of hugeadm command? How can I configure HugePage using hugeadm command? Check the supported hugepage size in the system. Change and configure hugepage using hugeadm command with minimum and maximum threshold value in hugepage pool list.

How do I configure HugePage using hugeadm command in Linux
 
hugeadm displays and configures the systems huge page pools. The size of the pools is set as a minimum and maximum threshold. The minimum value is allocated up front by the kernel and guaranteed to remain as hugepages until the pool is shrunk. If a maximum is set, the system will dynamically allocate pages if applications request more hugepages than the minimum size of the pool. There is no guarantee that more pages than this minimum pool size can be allocated.

 

Install libhugetlbfs-utils

The hugeadm utility is provided by package libhugetlbfs-utils and can be used to displays and configures the systems huge page pools. The size of the pools is set as a minimum and maximum threshold.

Execute the following command to install libhugetlbfs-utils package.

NOTE:
On RHEL system you must have an active subscription to RHN or you can configure a local offline repository using which “yum” package manager can install the provided rpm and it’s dependencies.
# yum -y install libhugetlbfs libhugetlbfs-utils

 

Check supported HugePage Size

To displays all page sizes supported by the system, even if no pool is available

# hugeadm --page-sizes-all
2097152
1073741824

 

Check current HugePage Size

This command displays every page size supported by the system and has a pool configured

# hugeadm --page-sizes
2097152

You can also get this information from /proc/cpuinfo

# grep Hugepagesize /proc/meminfo
Hugepagesize:       2048 kB

 

Check HugePage Mount Points

Below command displays all active mount points for hugetlbfs

# hugeadm --list-all-mounts
Mount Point          Options
/dev/hugepages       rw,relatime

 

Check HugePage Threshold values

This displays the Minimum, Current and Maximum number of huge pages in the pool for each pagesize supported by the system. The minimum value is allocated up front by the kernel and guaranteed to remain as hugepages until the pool is shrunk. If a maximum is set, the system will dynamically allocate pages if applications request more hugepages than the minimum size of the pool.
There is no guarantee that more pages than this minimum pool size can be allocated.

# hugeadm --pool-list
      Size  Minimum  Current  Maximum  Default
   2097152    12850    12850    12850        *
1073741824        0        0        0

Here,

Minimum -	This is the size of the static pool and there will always be at 
			least this number of hugepages in use by the system, either by 
			applications or kept by the kernel in a reserved  pool.  
			
Current -	This value is the number of hugepages currently in use, either 
			by applications or stored on the kernels free list. 
			
Maximum -	This value is the largest number of hugepages that can be in 
			use at any given time.

 

Configure HugePage using hugeadm

The (--pool-pages-min) option sets or adjusts the Minimum number of hugepages in the pool for pagesize size. size may be specified in bytes or in kilobytes, megabytes, or gigabytes by appending K, M, or G respectively, or as DEFAULT, which uses the system’s default huge page size for size.

Here we are setting 4096 as the minimum number of pages for 2MB HugePage.

# hugeadm --pool-pages-min 2MB:4096

 

The (--pool-pages-max) option sets or adjusts the Maximum number of hugepages. Note that while the Minimum number of pages are guaranteed to be available to applications, there is not guarantee that the system can allocate the pages on demand when the number of huge pages requested by applications is between the Minimum and Maximum pool sizes.

# hugeadm --pool-pages-max 2MB:12850

Verify the pool list again

# hugeadm --pool-list
      Size  Minimum  Current  Maximum  Default
   2097152     4096     4096    12850        *
1073741824        0        0        0

 

Lastly I hope the steps from the article to configure HugePage using hugeadm command in Linux was helpful. So, let me know your suggestions and feedback using the comment section.

 

Leave a Reply

Your email address will not be published. Required fields are marked *