Our team is interested in using the TBB memory allocation library on linux. Is there a way to have this library use huge pages instead of 4k pages?
There is no support for large pages currently. However I believe one can add it quite easily. All one has to do is:
1. set up mmapRequestSize to large page size (2MB or whatever it is on your system):
static size_t mmapRequestSize = 0x0100000;
2. patch getRawMemory() function to allocate large pages.
3. patch freeRawMemory() function to free large pages.
That's it.
Since current raw block size used by TBB is 1MB which is quite close to size of large pages (2MB), I think one may leave allocation algorithm itself as-is.