Working with hugetlbfs huge-page support
Typical tasks for working with hugetlbfs huge-page support include reading the current number of huge pages, changing the number of huge pages, and display information about available huge 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 huge-page memory. See your database documentation to find out if and how it can be configured to use huge-page memory.
Depending
on your version of Java™, you might require specific options to
make a Java program use the huge-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 huge 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
huge pages currently available and the huge-page
size:
cat /proc/meminfo ... HugePages_Total: 4 HugePages_Free: 4 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2097152 kB ...