Working with hugetlbfs large page support
Typical tasks for working with hugetlbfs large page support include reading the current number of large pages, changing the number of large pages, and display information about available large pages.
About this task
mmap() or SysV
shared memory system calls. More detailed information can be found in the Linux® kernel source tree under
Documentation/vm/hugetlbpage.txt, including implementation examples. Your database product might support large page memory. See your database documentation to find out if and how it can be configured to use large page memory.
Depending on your version of Java, you might require
specific options to make a Java™ program use the large page
feature. For IBM® SDK, Java Technology Edition 7, specify the -Xlp option. If you use the
SysV shared memory interface, which includes java -Xlp, you must adjust the
shared memory allocation limits to match the workload requirements. Use the following sysctl attributes:
- /proc/sys/kernel/shmall
- Defines the global maximum amount of shared memory for all processes, specified in number of 4 KB pages.
- /proc/sys/kernel/shmmax
- Defines the maximum amount of shared memory per process, specified in number of Bytes.
# echo 5242880 > /proc/sys/kernel/shmall # echo 21474836480 > /proc/sys/kernel/shmmax
Procedure
Example
- Specify 2 GB large pages and pre-allocate them to the page pool at boot time. Use the following
kernel boot parameters:
default_hugepagesz=2G hugepagesz=2G hugepages=4
- After booting, read /proc/meminfo to see information about the amount of
large pages currently available and the large page
size:
cat /proc/meminfo ... HugePages_Total: 4 HugePages_Free: 4 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2097152 kB ...