Huge pages on Linux p-series

The CPU-Cache translation lookaside buffer (TLB) stores information about conversions from an virtual page address to the physical page address, and every byte access to physical memory requires a conversion (called a “cache miss”). Although these cache misses are very expensive, you can improve the TLB hits is by enabling “huge pages” on Linux p-series machines.

Huge pages use fewer pages to cover the physical address space, so the size of “book keeping” (mapping from the virtual to the physical address) decreases, requiring fewer entries in the TLB and improving the system performance.

Adaptive Server version 15.0.3 and later allocates shared memory using huge pages by default. However, if the system does not have enough huge pages—or is not configured for huge pages,—Adaptive Server uses regular pages, and writes this message to the error log:

Could not allocate memory using Huge Pages. Allocated using regular pages. For better performance, reboot the server after configuring enough Huge Pages

Adaptive Server adjusts its shared memory up to the nearest multiple of 256MB. For example, if you configure Adaptive Server with 800MB of shared memory, it is rounded off to 1GB (some versions of Linux do not allow you to allocate huge pages if the size is not a multiple of Hugepagesize).

Before starting Adaptive Server, check /proc/meminfo to make sure Linux already has huge pages configured:

cat /proc/meminfo
....
HugePages_Total:    32
HugePages_Free:     32
Hugepagesize:    16384 kB

NoteMemory you allocate for huge pages is used for the shared memory only. If you allocate too many huge pages, this may lead to Adaptive Server excessively swapping physical pages. You should only allocate the required number of huge pages.