-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using HugePages on TCMalloc #190
Comments
TCMalloc is routinely used with Transparent Huge Pages and it works out-of-the-box. For backing memory with hugetlbfs, you can install a custom system allocator ( |
So I am working on an application where I want to exclusively force hugepages to be used instead of transparent HugePages. |
Just checking in, so I tried running one of the test files: If you could please let me know how and where I can back memory with |
So I have made a rough code that creates a region that has been mapped to hugetlb using
Here I have printed the The output is as follows:
As we can see above: |
My recollection is that Once installed, though, we might not immediately need more virtual address space. For example, |
@ckennelly how does the region factory logic tell MmapAligned how to back this memory ? We don't see a flag or any argument when creating the region factory to tell it to use hugetlbfs. To give you a bit more background, I am more familiar with the memfs implementation in gperfs/tcmalloc, over there it allows us to specify TCMALLOC_MEMFS_MALLOC_PATH which helps us initialize the memfs allocator rather than the default system_allocator (which allocates from small page pool). See this for reference - https://github.com/gperftools/gperftools/blob/master/src/memfs_malloc.cc#L232 For that matter, for gperftools/tcmalloc we even updated this code to ensure that we disable fallback option, so that all allocations from tcmalloc only comes from the hugepages backed region. See - gperftools/gperftools@b7607ee We have been meaning to experiment with the per-cpu cache effort that is available with this fork of tcmalloc but for us to make any progress with this I would first like to ensure that we can get all objects exclusively allocated from the hugepage pool. |
Resurrecting to say I have a similar use case We disable transparent hugepages in kernel params because they showed nondeterminism/ high variance in our latency, but I want to try using /dev/hugepages to see if we get better performance. Like @alokkataria mentioned this is easy in gperftools/tcmalloc |
Wanted to know if there was a fixed procedure on how to enable the use of HugePages on TCMalloc; like how it can be done on gperftools tcmalloc.
I am using TCMalloc on Ubuntu 22.04.
The text was updated successfully, but these errors were encountered: