[vbox-dev] When is "largepages" necessary and what does it do?

Thorsten Schöning tschoening at am-soft.de
Mon May 28 17:35:53 UTC 2018

Guten Tag Thorsten Schöning,
am Montag, 28. Mai 2018 um 16:39 schrieben Sie:

> If "largepages" is necessary to get usable performance for some amount
> of RAM, why is it allowed to fail while continuing the VM?[...]

My VM-host is UB 16.04 LTS which includes a recent enough kernel for
"Transparent Hugepage Support", and doesn't provide "huge pages"
manually using /proc/sys/vm/nr_hugepages or such:

> $ cat /proc/meminfo
> HugePages_Total:       0
> HugePages_Free:        0
> HugePages_Rsvd:        0
> HugePages_Surp:        0
> Hugepagesize:       2048 kB

So I assume requests for huge pages by VirtualBox are answered using
that mechanism?

THP is documented with the following feature:

> - if a hugepage allocation fails because of memory fragmentation,
>   regular pages should be gracefully allocated instead and mixed in
>   the same vma without any failure or significant delay and without
>   userland noticing


So we already know that VirtualBox itself is able to detect to not get
huge pages fast enough and falling back to not using them.

Is it able to detect that for the mentioned transparent fallback of
THP as well? I assume it's not, else it wouldn't be transparent
anymore. :-)

If that happens, even while VirtualBox things it has huge pages in
use, performance would be as with that no beeing the case, correct?

But would one still benefit of VirtualBox thinking to use huge pages,
because "khugepaged" could make some available anytime during the
runtime of the VM, providing better performance than VirtualBox
falling back on its own? I assume yes.

That would mean in theory that if requests for huge pages are
fullfilled by THP, VirtualBox would never assume to not being able to
get huge pages fast enough, would always keep using "largepages" and
performance would depend entirely on what "khugepaged" is able to

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning       E-Mail: Thorsten.Schoening at AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

More information about the vbox-dev mailing list