Linux Kernel 2.6.38 and the new transparent huge pages
New in Linux kernel 2.6.38 is the Transparent huge pages features.
With no huge page the kernel have to maps the memory with 4k blocks. The process of mapping and scanning this page table is time consuming. In the past we used hugepages to use 2M/4M block size thus lowering the page table size, and not every program were able to use it as it had to be coded to use huge pages.
The transparent huge pages can now use the huges pages even with software that are not coded to use them.
A kernel parameter can be used to tell the kernel to always use huge pages or to only use them when requested with the madvise(MADV_HUGEPAGE) parameter.
It can be adjusted by using /sys/kernel/mm/transparent_hugepage/enabled, sending those values change the behaviour of huge pages :
echo always >/sys/kernel/mm/transparent_hugepage/enabled
echo madvise >/sys/kernel/mm/transparent_hugepage/enabled
echo never >/sys/kernel/mm/transparent_hugepage/enabled
For more information refer to Linux kernel documentation : Documentation/vm/transhuge.txt
