diff --git a/cpp/src/interop/detail/arrow_allocator.cpp b/cpp/src/interop/detail/arrow_allocator.cpp index e56a4bad0d0..577a8962eb4 100644 --- a/cpp/src/interop/detail/arrow_allocator.cpp +++ b/cpp/src/interop/detail/arrow_allocator.cpp @@ -26,6 +26,8 @@ namespace detail { /* Enable Transparent Huge Pages (THP) for large (>4MB) allocations. `buf` is returned untouched. + Enabling THP can improve performance of device-host memory transfers + significantly, see . */ template T enable_hugepage(T buf) @@ -33,9 +35,6 @@ T enable_hugepage(T buf) if (buf->size() < (1u << 22u)) { // Smaller than 4 MB return buf; } - if(std::getenv("ENABLE_HUGEPAGEPATH") == nullptr) { - return buf; - } #ifdef MADV_HUGEPAGE const auto pagesize = sysconf(_SC_PAGESIZE); @@ -43,12 +42,9 @@ T enable_hugepage(T buf) if (addr == nullptr) { return buf; } std::size_t length{static_cast(buf->size())}; if (std::align(pagesize, pagesize, addr, length)) { - std::cout << "enable_hugepage() - length: " << length << std::endl; // Intentionally not checking for errors that may be returned by older kernel versions; // optimistically tries enabling huge pages. madvise(addr, length, MADV_HUGEPAGE); - } else { - std::cout << "cannot align - length: " << length << ", addr: " << addr << std::endl; } #endif return buf;