# Transparent huge pages kernel option (pros/cons) feedback?

## wrc1944

Anyone have any experience with enabling Transparent huge pages in the kernel? I just built a new 3.1.4 kernel on one of my Gentoo boxes, and enabled it to see if I could notice any advantages.  It has been in mainline since 2.6.38, but I just missed it.   :Rolling Eyes: 

I ran across this, and thought it might be interesting. 

http://www.phoronix.com/scan.php?page=article&item=linux_transparent_hugepages&num=1

Page 2 has benchmarks.

Also, a recommended LWN article: Transparent huge pages in 2.6.38  https://lwn.net/Articles/423584/

A quick google search for "transparent hugepage"  turns up lots of good info.

A brief quote from one of these:

 *Quote:*   

> Processors manage memory in small units called "pages" (which is 4 KB in size in x86). Each process has a virtual memory address space, and there is a "page table" where all the correspondencies between each virtual memory address page and its correspondent real RAM page are kept. The work of walking the page table to find out which RAM page corresponds to a given virtual address is expensive, so the CPU has a small cache to store the result of that work for frequently accessed virtual addresses. However, this cache is not very big and it only supports 4KB pages, so many data-intensive workloads (databases, KVM) have performance problems because all their frequently accessed virtual addresses can't be cached.
> 
> To solve this problem, modern processors add cache entries that support pages bigger than 4KB (like 2MB/4MB). Until now, the one way that userspace had to use those pages in Linux was hugetblfs, a filesystem-based API. This release adds support for transparent hugepages ( - hugepages are used automatically where possible. Transparent Huge Pages can be configured to be used always or only as requested with madvise(MADV_HUGEPAGE), and its behaviour can be changed online in /sys/kernel/mm/transparent_hugepage/enabled. For more details, check Documentation/vm/transhuge.txt

 

----------

## Hu

Have you read LWN: Huge pages, slow drives, and long delays?  It came out a few weeks ago and highlights one of the potential drawbacks to using transparent huge pages on personal systems.  The problem can happen on any system, but headless servers are somewhat less likely to be used in the way that triggers the unpleasant behavior.

----------

## kerframil

 *Hu wrote:*   

> Have you read LWN: Huge pages, slow drives, and long delays?  It came out a few weeks ago and highlights one of the potential drawbacks to using transparent huge pages on personal systems

 

Apparently, Linux 3.3 addresses this issue.

----------

## kimmie

For me transparent huge pages on a 3.2 kernel causes long delays (20-30 seconds) using VMWare workstation 8. I have workstation configured to use about 80% of host memory, and not to swap client VM memory. I didn't check to see if changing that configuration helped, but disabling transparent huge pages certainly did.

----------

