Comment 12 for bug 743688

Revision history for this message
Todd Vierling (duh) wrote :

Based on what we've been seeing maintaining Oracle Linux, there are many workloads for which THP results in a ~9-10% performance hit overall on the system, and this includes kernels up through 3.8.13 (which we're using as the baseline for a new kernel in that distro). It has to do with the fact that the memory allocator uses the slowpath almost all the time, rather than a faster path when memory fragmentation is low. It's not that THP is _enabled_ so much that it is _compiled into the kernel at all_; as a result, we're probably going to remove it for the time being, and re-enable it when the allocator is revamped.

However, there is also good reason for choosing madvise as the default. Transparent hugepages *cannot be swapped out*. Read that carefully: when you use them, the allocated memory is always in-core, as if it had been mlock()ed into place. While systems with plenty of memory shouldn't need to worry about this (hell, I run my systems without swap at all!), it's a consideration to keep in mind. Applications for which huge pages may provide proven benefit, but aren't required, should start to adopt MADV_HUGEPAGE as an advisory call; this might include databases, Web browsers, and other data-intensive applications. That way, you don't run the risk of hitting memory walls thanks to a bunch of smaller system processes that just happen to use hugepages because it's set to "always".