Huge Pages Support?

e100

Renowned Member
Nov 6, 2010
1,268
45
88
Columbus, Ohio
ulbuilder.wordpress.com
Now that I have some systems with 128GB of RAM it seems that using HugePages would be very beneficial.

For example, the page table for 16GB of RAM using 4k pages is 32MB, using hugepages it is 64KB
Keeping 64KB in the CPU Cache is much easier than 32MB

Looking at change logs I see that openvz at one point set transparent huge pages to disabled by default (enabled by default in upstream redhat)
But I can not find an explination as to why it was disabled.

Is there some issue between openvz and transparent huge pages?
If so, can I use transparent huge pages with KVM if I do not use any openvz containers?
 
That document says it is not good for KVM.
Essentially, you would need an OpenVZ only node, and a KVM node

No, it says Hugetlbfs is bad for KVM, not Transparent Huge Pages.
There are two ways to use Huge Pages:
1. Transparent Huge Pages (THP), as the name implies, transparent to the process.
2. Hugetlbfs works with applications written specifically to use Huge Pages and access the huge pages via the pre-allocated Hugetlbfs

Hugetlbfs should perform the best but you loose things like ballooning, KSM, ability to swap VM when memory pressure is high, etc.
Since I do not want to loose all those KVM features I am only interested in THP.

One of the benchmarks in that document were faster using KVM with THP used in the Host and the Guest than when running on bare metal. see page 25
 
Now that I have some systems with 128GB of RAM it seems that using HugePages would be very beneficial.

For example, the page table for 16GB of RAM using 4k pages is 32MB, using hugepages it is 64KB
Keeping 64KB in the CPU Cache is much easier than 32MB

Looking at change logs I see that openvz at one point set transparent huge pages to disabled by default (enabled by default in upstream redhat)
But I can not find an explination as to why it was disabled.

Is there some issue between openvz and transparent huge pages?
If so, can I use transparent huge pages with KVM if I do not use any openvz containers?

Hi,
yes it was disable by default by openvz kernel, don't remember when exactly, maybe 1 year ago.
But it's safe to enable it for kvm. (I'm using 512GB systems with transparaent hugepage enabled)

Code:
echo always > /sys/kernel/mm/transparent_hugepage/enabled 
echo always > /sys/kernel/mm/redhat_transparent_hugepage/enabled

(don't known why we have 2 entries, maybe it's related to openvz patches)
 
Do you know if it causes issues with openvz or not?

The change log had no explination just said something like 'disable the by default'

That is all the info my googlefu was able to find.

I don't remember exactly, but it was related to this

http://kb.parallels.com/en/113568
* Transparent hugepages support has been disabled by default. (PSBM-11811)
If necessary, you can enable it by running this command:
# echo always > /sys/kernel/mm/redhat_transparent_hugepage/enabled

But I can't found anymore the reference of PSBM-11811.

I think it's was a problem for very specific case.
(I need to check the proxmox pve-devel mailing archive, we have discussed about this when the change has been done)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!